First of all I would like to say ‘hello’ to you as a new user of this forum. Also I want to apologize for my bad English language(I hope you’ll understand what needs to be understood). In fact I’m not total new on this forums anyway, I use it very often but this is my first post here.
In order to avoid any more useless text I’m going more or less to the case: So, I’m an fan of the game mode called ‘Role Playing’. Some people might consider it as stupidity but tastes should not be discussed. Consequently with this passion I decided with friend to create a map that would be adapted to the each of our needs. Since I am a layman when it comes to programming I need help from someone. Most scripts that I wanted to write I did wrote (more or less well) but there is one that remained and for me it have a very high value.
My friend put the idea to create a faint system. The idea is that when the life of the unit drops to + / - 20% the fainting unit starts a death animation and unit side is changed to Neutral. The unit is intended to lie in that state until as long as its life will be equal to or greater than 50%. The script itself is fairly easy to write, but making it to work on more units (MUI) is black magic for me. If someone could help with this – give some tips and even rewrite the script - I would be very grateful. In fact, I did readed many guides buts still I’m too unexperienced to do it well. I tried many ways but they are kind of pathetic. I’ll paste here a script that works only for one unit.
Here are two triggers:
FIRST ONE:
SECOND ONE:
It isn’t hard to guess why this isn’t working. Of course it’s because of ‘Fainted’ variable. It does change globally not MUI. I don’t know how to change that and I will appreciate any help that someone will give me. Someone of you probably would tell "hell, just delete that darn variable and this will work well". Well, let's say. But if I'll do that the death animation will repeat at any damage I will cause to unit.
I look forward for your responses and please – don’t be too hard on newbie :>.
PS: If there's something wrong with title of this thread or something else just tell and I'll change it.
PS2: I did searched for any threads like that but I didn't found them. If there is already one(I still don't think so) just be so kind and give me link to it. Maybe I just somehow missed it.
Regards, Voltare.
In order to avoid any more useless text I’m going more or less to the case: So, I’m an fan of the game mode called ‘Role Playing’. Some people might consider it as stupidity but tastes should not be discussed. Consequently with this passion I decided with friend to create a map that would be adapted to the each of our needs. Since I am a layman when it comes to programming I need help from someone. Most scripts that I wanted to write I did wrote (more or less well) but there is one that remained and for me it have a very high value.
My friend put the idea to create a faint system. The idea is that when the life of the unit drops to + / - 20% the fainting unit starts a death animation and unit side is changed to Neutral. The unit is intended to lie in that state until as long as its life will be equal to or greater than 50%. The script itself is fairly easy to write, but making it to work on more units (MUI) is black magic for me. If someone could help with this – give some tips and even rewrite the script - I would be very grateful. In fact, I did readed many guides buts still I’m too unexperienced to do it well. I tried many ways but they are kind of pathetic. I’ll paste here a script that works only for one unit.
Here are two triggers:
FIRST ONE:
-
Faint System
-
Events
-
Unit - A unit is attacked
-
-
Conditions
-
Actions
-
Set TempUnit = (Attacked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(TempUnit is a Building) equal to NO
-
(Percentage life of TempUnit) less than or equal to 25.00
-
Fainted is equal to NO
-
-
Then - Actions
-
Animation - Play TempUnit's death animation
-
Unit- Change ownership of TempUnit to Neutral and Keep the color
-
Set Fainted = YES
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
SECOND ONE:
-
Faint-Out
-
Events
-
Unit - A unit Starts to cast an abillity
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Target unit of ability being cast) is a Building) equal to NO
-
(Ability being cast) equal to Healing
-
Fainted equal to YES
-
(Percentage life of (Target unit of ability being cast)) greater than or equal 50.00
-
-
Then - Actions
-
Animation - Play (Target unit of ability being cast) stand animation
-
Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and keep the color
-
Set Fainted = NO
-
-
Else - Actions
-
Do nothing
-
-
-
-
It isn’t hard to guess why this isn’t working. Of course it’s because of ‘Fainted’ variable. It does change globally not MUI. I don’t know how to change that and I will appreciate any help that someone will give me. Someone of you probably would tell "hell, just delete that darn variable and this will work well". Well, let's say. But if I'll do that the death animation will repeat at any damage I will cause to unit.
I look forward for your responses and please – don’t be too hard on newbie :>.
PS: If there's something wrong with title of this thread or something else just tell and I'll change it.
PS2: I did searched for any threads like that but I didn't found them. If there is already one(I still don't think so) just be so kind and give me link to it. Maybe I just somehow missed it.
Regards, Voltare.