Raised This Month: $ Target: $400
 0% 

NS - Simulating Spores/Umbra


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 03-15-2005 , 22:35   NS - Simulating Spores/Umbra
Reply With Quote #1

Basically what I'm trying to do is to make the onos release a cloud of spores around himself every two seconds while he is digesting. Problem I'm having is the damage of the spores.

It would be easier if I could just call all of this in one function: create the spores and make them last for 7 seconds, do damage to all players within the defined radius for the same number of seconds the spores appear. It's pretty much identical as if a lerk was shooting spores at an onos every two seconds. I have the code for the spores effect and the damage, but not the timing.

How do I simulate spores as if the lerk has just fired a spore? I have an idea of how to create the effect and do damage but the damage is only done once every time the effect is simulated, instead of : every second do damage for seven seconds like when a lerk does it. I was looking at the sporemines plugin, it had what I needed but I was having trouble implementing it.

Here's what I got so far for drawing spores wherever the player(id) is:
Code:
public drawsmspores(id) {     new Float:origin[3]     pev(id,pev_origin,origin)     emit_sound(id,CHAN_ITEM,song_spore,0.8,ATTN_NORM,0,PITCH_NORM)     playback_event(0,id,g_EventParticle,0.0,origin,Float:{0.0,0.0,0.0},0.0,0.0,13,0,0,0) //spore effect }

After I call the spore visual effects, I then call another function to do damage to all the player's within the defined range. The problem I'm having is how to keep the damage to keep on damaging for a certain number of seconds (the length of time the spores appear).

The part in sporemines I need, is when the player triggers the mine and causes it to release spores.

Thanks
KCE is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-16-2005 , 13:47  
Reply With Quote #2

Code:
#define DAMAGE_TASK_ID 27 public release_teh_spores(id) {    new origin[3];    get_user_origin(id,origin);    // spore graphics here    new parms[4];    parms[0] = origin[0];    parms[1] = origin[1];    parms[2] = origin[2];    parms[3] = 1; // current iteration    set_task(1.0,"damage",DAMAGE_TASK_ID,parms); } public damage(parms[]) {    // grab origin from parms    new origin[3];    origin[0] = parms[0];    origin[1] = parms[1];    origin[2] = parms[2];    // do your damage code here    parms[3]++; // add to iteration    // if we still have some more iterations to go    if(parms[3] <= 7) {       set_task(1.0,"damage",DAMAGE_TASK_ID,parms);    } }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 03-16-2005 , 18:13  
Reply With Quote #3

Thanks for the tip. I'm having a problem in-game with invalid player. I've been able to fix it by checking if user is connected but then it doesn't do damage. It keeps saying this:

Code:
L 03/16/2005 - 16:18:31: [Engine] Invalid player 0 (not in-game)
L 03/16/2005 - 16:18:32: [AMXX] Native error in "entity_range" on line 164 (file "onos_gas.sma").
KCE is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-16-2005 , 22:14  
Reply With Quote #4

You are checking with is_valid_ent(i) . Use is_user_connected(i) and that should fix it up.

Also, parms[1] is the Y value of the origin, not the full origin vector.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 03-16-2005 , 22:47  
Reply With Quote #5

Alright figured it out. BTW, do you know how I would simulate umbra? I don't really know how to use the playback_event function. Generally I'd post NS questions in the modns.org forums, but they're down right now...
KCE is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode