Hey guys. I am wanting to make an enemy for an RPG I am working on with a behavior that reacts to how many times it is hit in a certain period of time. Specifically, I want it so that if you attack this enemy say, 5 times or more in under 5 seconds, it will go berserk and have its movement speed increase drastically for a short period of time. I am hoping to do this with triggers since I am not yet very familiar with the data editor or the galaxy language. Any of you creative folk out there have an idea for how this might work?
I would recommend doing this via data editor, but if you must use triggers.
Use the even, any unit takes dmg, check if the unit that takes dmg is the one you are talking about, if so, add one to how many times he has been attacked, and start a timer, by the end of that timer, if he has had X amount of hits, then he will berserk. The only problem doing it this way, is if the timer dosnt overlap perfectly.
Rollback Post to RevisionRollBack
Random Information
Tutorials - Map Development - Galaxy wiki
|Issues? PM me|
I think that what I would actually prefer to do is have it work this way:
Every time he gets hit, it would begin a stacking buff, and that stacking buff lasts for 3 seconds and fall off unless he got hit again, in which case it would stack to 2, 3 etc. and refresh the duration. Once the buff gets to 4 then he would go berserk and be immune to the buff for the duration.
I am not exactly sure how the data editor works or how you define events, conditions, and actions with it. Maybe you could point me in the direction of a good tutorial?
I don't want to ask you to explain behaviors to me but perhaps you could point me in the direction of a decent tutorial, or tell me how behaviors compare to something in the trigger editor?
id make a tutorial if i knew how to do it. that trigger took me like a while to make(i taught it to myself). i try and help people with their problems so i can learn how to do things.
Hey guys. I am wanting to make an enemy for an RPG I am working on with a behavior that reacts to how many times it is hit in a certain period of time. Specifically, I want it so that if you attack this enemy say, 5 times or more in under 5 seconds, it will go berserk and have its movement speed increase drastically for a short period of time. I am hoping to do this with triggers since I am not yet very familiar with the data editor or the galaxy language. Any of you creative folk out there have an idea for how this might work?
I would recommend doing this via data editor, but if you must use triggers.
Use the even, any unit takes dmg, check if the unit that takes dmg is the one you are talking about, if so, add one to how many times he has been attacked, and start a timer, by the end of that timer, if he has had X amount of hits, then he will berserk. The only problem doing it this way, is if the timer dosnt overlap perfectly.
@Molsterr: Go
I think that what I would actually prefer to do is have it work this way:
Every time he gets hit, it would begin a stacking buff, and that stacking buff lasts for 3 seconds and fall off unless he got hit again, in which case it would stack to 2, 3 etc. and refresh the duration. Once the buff gets to 4 then he would go berserk and be immune to the buff for the duration.
I am not exactly sure how the data editor works or how you define events, conditions, and actions with it. Maybe you could point me in the direction of a good tutorial?
edit: the variable only goes to 4, because on the 5th hit he goes berserk edit2: "attacked" variable is global integer
i used stimpack as the buff all you would need to do in the data editor is make a fake debuff w/ no effects
@torrasqu: Go
Wow, that's awesome. Thanks a lot for taking the time to figure that one out. I will implement and test asap. Here's to making non-boring enemies!
its still better to learn it with behaviors. that trigger is severely limited.
i forgot to mention this in the last post, "Attacked" is a global integer. and as such, it can only be used for 1 instance of the trigger ;[
@torrasqu: Go
I don't want to ask you to explain behaviors to me but perhaps you could point me in the direction of a decent tutorial, or tell me how behaviors compare to something in the trigger editor?
id make a tutorial if i knew how to do it. that trigger took me like a while to make(i taught it to myself). i try and help people with their problems so i can learn how to do things.
idk how to use behaviors yet tho ;[
@torrasqu: Go
Well either way, this works nicely. I am having a blast learning to turn my ideas into reality and this community has been nothing but helpful :D