AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Track when a sequence ends? (https://forums.alliedmods.net/showthread.php?t=133207)

alexx109 07-22-2010 23:18

Track when a sequence ends?
 
I mean, lets take this situaion by example:
I have an entity, that entity has a model, that model has sequences. I need to set that entity's sequence to 0, and after sequence 0 has ended, i must put sequence 3 (this is just a example). So i can't set sequence 3 right after sequence 0 ends just by doing this:

Code:

entity_set_int(ent, EV_INT_sequence, 0)
entity_set_int(ent, EV_INT_sequence, 3)

obviously don't works...
So, there's any way to track a sequence?

I've already tried to get EV_FL_frame hoping it stores the actual sequence's frame the entity is in, but it never gets updated...

I don't think setting a task with the time in seconds that the sequence has and setting the other sequence on the function called by the task is the right way... Anyone knows how to do that, if it's possible to do so?

alexx109 07-23-2010 09:33

Re: Track when a sequence ends?
 
Sorry for the bump but i'm really needing this and this seems to be an interesting question :x

joropito 07-23-2010 10:22

Re: Track when a sequence ends?
 
To start a sequence you must do this

PHP Code:

entity_set_float(entEV_FL_framerate1.0)
entity_set_float(entEV_FL_animtimehalflife_time())
entity_set_int(entEV_INT_sequenceSEQUENCE_NUMBER

With this, EV_FL_frame should be updated

alexx109 07-23-2010 11:13

Re: Track when a sequence ends?
 
Sad to say, but EV_FL_frame is still not updated...

a part of the code (this is just a test plugin):

PHP Code:

public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_clcmd("say /teste1""criaEntity")
 
register_think("summon""thinkSummon")
}
 
public 
criaEntity(id){
 new 
Float:origin[3], Float:mins[3], Float:maxs[3]
 
 
entity_get_vector(idEV_VEC_originorigin)
 
origin[0] += 50.0
 ent 
create_entity("func_breakable")
 
 
entity_set_float(entEV_FL_takedamage1.0)
 
entity_set_float(entEV_FL_health500.0)
 
 
entity_set_string(entEV_SZ_classname"summon")
 
 
entity_set_model(entmodel)
 
 
mins[0] = -31.0
 mins
[1] = -31.0
 mins
[2] = 0.0
 maxs
[0] = 31.0
 maxs
[1] = 31.0
 maxs
[2] = 70.0
 entity_set_size
(entminsmaxs)
 
 
entity_set_origin(entorigin)
 
 
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
 
entity_set_int(entEV_INT_movetypeMOVETYPE_TOSS)
 
 
entity_set_float(entEV_FL_framerate1.0)
 
entity_set_float(entEV_FL_animtimehalflife_time())
 
entity_set_int(entEV_INT_sequence0)
 
drop_to_floor(ent)
 
entity_set_float(entEV_FL_nextthinkhalflife_time() + 0.2)
 
}
 
public 
thinkSummon(ent){
 new 
Float:frame entity_get_float(entEV_FL_frame)
 
client_print(0print_chat"Frame eh: %f"frame)
 
entity_set_float(entEV_FL_nextthinkhalflife_time() + 0.2)


i get the EV_FL_frame every think of the entity (about 5 times a second)
and it never gets out of 0.000000

i don't think there's any way to track the frames nor the sequence end :X


All times are GMT -4. The time now is 00:17.

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