Model sequences in GoldSRC

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
33
Реакции
14
Ошибка
Adding model with sequences
Error log
Only the first sequence works
Редактор карт
J.A.C.K.
Hello DEV-CS Mappers,

I tried to add a model in map map with cycler_sprite and I have 2 questions. I am totally new in mapping and I really enjoy it, but I couldn't find solution for my problem.

Firstly, the model has 5 sequences ( idle, dance1, dance2, dance3, dance4). Adding it with J.A.C.K Editor we have only option for settings Framerates per second. It runs only the first sequence (idle).. The rest of them which I would like to run consequently.. don't work. Only the first animation runs.. How can I make that it runs from 1-5 and repeat them consistently..

Secondly, the model is NOT solid.. Can you give me an advice how can I make the model solid. The only way I know is creating brush around it, but the model has various hitboxes.. so it won't be 100% accurate. But if that is the only way, I will do it..

Thanks in advance for your answers!
 
В этой теме было размещено решение! Перейти к решению.

iPlague

♿️
Сообщения
230
Реакции
130
Помог
2 раз(а)
1. Hi, try to decompile model and change order of sequences.
In mapping we don't have possibility to use list of sequences, so use a necessary animation first in list.
 
Сообщения
33
Реакции
14
Yes, I did it like that. Thank you! But if it is not possible to run all the animations, why there are 4 animations? Maybe there is AMXX Plugin needed for that or? If yes, is there any plugin here which can run the list of sequences consequently?
 

iPlague

♿️
Сообщения
230
Реакции
130
Помог
2 раз(а)
menkisa00, look through all maps models, they all have only one animation, isn't they? f.e. chicken on de_italy :)

Yes, amxx. Set origin, set model, set think.
find any stock that can play animation, a lot of ways how to do it
 
Сообщения
33
Реакции
14
I was looking for a proper stock already. Couldn't find any that matches my case... Thanks anyway.
 

iPlague

♿️
Сообщения
230
Реакции
130
Помог
2 раз(а)
Sometning like this :D

under spoiler - how to play list of 5 animations in cycle (loop) without tasks, just use nextthink заloopить анимацию :D
Maybe code is wrong way, but I used it in one my plugin and it works

Код:
new Float:AnimTime[5] = {1.0, 2.0, 3.0, 4.0, 5.0}; // for example duration of each animation in list

public set_model(Float:forigin[3]){  // some function than will set model at your float origin
    new ent = rg_create_entity("info_target", false);
    if(is_nullent(ent))
        return -1;
    set_entvar(ent, var_origin, forigin);   // some float origin u need
    set_entvar(ent, var_model, "model.mdl"); //
    set_entvar(ent, var_modelindex, g_iModel); // index of model g_iModel = precache_model("models.mdl");
    set_entvar(ent, var_classname, "entity_model");
    set_entvar(ent, var_movetype, MOVETYPE_NONE); // static model
    set_entvar(ent, var_solid, SOLID_BBOX); // solid model
    //set_entvar(ent, var_body, iBodyNumber); // if model has more than 1 body
   
    set_entvar(ent, var_sequence, 0); // 1th sequence to start all this shit
    set_entvar(ent, var_gaitsequence, 1);
    set_entvar(ent, var_frame, 1.0); // chose necessary value
    set_entvar(ent, var_framerate, 1.0); // chose necessary value
    set_entvar(ent, var_animtime, get_gametime());
   
    set_entvar(ent,var_nextthink, get_gametime() + AnimTime[0]); // set duration of 1th anim
   
    SetThink(ent,"@ThinkEntity");   // set think and change animation nexttime
}

@ThinkEntity(ent){
    if(!is_entity(ent))
        return
       
    set_entvar(ent, var_frame, 1.0);  // chose necessary value
    set_entvar(ent, var_framerate, 1.0);  // chose necessary value
    set_entvar(ent, var_animtime, get_gametime());
   
    new seq = get_entvar(ent, var_sequence);
   
    seq = (seq + 1) % 5; // just trust me :D
   
    set_entvar(ent, var_sequence, seq); // so we set next anim from our list, if list ended we set 1th animation again
       
    set_entvar(ent,var_nextthink, get_gametime() + AnimTime[seq]); // set duration of anim
}
 
Последнее редактирование:
Сообщения
156
Реакции
205
Помог
5 раз(а)
menkisa00, it's possible to switch animation in mapping by hitting the model. For that you can creatre a trigger_multiple brush entity(or any other activator like button) with trigger_hurt object as a target. trigger_hurt must touch the model hitbox. And in your case you have to use cycler instead of cycler_sprite. Moreover, the cycler keeps the original hitboxes.
Note: the animations will be switched in a sequence => you can't choose the animation to play
A sample is attached.
 

Вложения

  • 58.2 KB Просмотры: 13
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу