[JASS] Morale Trigger

Level 3
Joined
Nov 12, 2006
Messages
35
I posted this once and it turned into a GUI system, however I want a Jass system. I'm making a war game where every unit has a value, morale, that increases and decreases depending on a few things. If a unit's morale becomes 0, it flees from the nearest enemy until it is far away from any enemy unit, then it rallies.

Will someone help me create this system in Jass? Before I state the specifics, let me say: I was planning on having mana be morale, which would make things easier, however if I could use another value it would be better. Would it be feasible to have a value for every unit that could be constantly altered? Would it cause too much lag? If so, Ill just go with mana.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
What is wrong with the GUI trigger someone (don't remember who, too lazy to check) made for you ?

Anyway, of course you can make a value and attach it to every unit in the map, you won't be able to see it though (unless you make a thing that will show it via floating texts, or something similar, which won't be good).

I suddenly remembered there are custom values. If you are not using them for anything else (or have a little system and know a bit of Jass so you can use them for multiple things) you can just use them.

The best solution would be using structs and attaching them to the units of course, but it requires vJass and since you don't know Jass, I don't think you want vJass at the moment :p
 
Level 3
Joined
Nov 12, 2006
Messages
35
I appreciate the help of the guy who was doing the GUI, but he had his hands full with other projects and his system didn't seem to work. I want to learn Jass, but for this project I was hoping someone else could do it. I would study the finished result. Of course whoever did it would get full credit in the map. As for using custom values, sounds good. In real life you cant "see" morale so it would work. Would you be willing to make the trigger/s?
 
Level 12
Joined
Mar 23, 2008
Messages
942
Well, when you don't have something done and ask to do the whole thing, people don't fell motivated to help... Unless they have the entire idea in mind and wanna to test it.

If you don't know how to do even the begin of trigger, you will have to wait a long time until someone appear motivated to do for you.
 
Level 4
Joined
Sep 9, 2004
Messages
112
Well I don't know Jass but I could definantly do this via GUI and use interger variable as your units morale and adjust it due to certain events and when it reaches zero cause them to flee any unit nearby. Can even make a leaderboard that displays the units morale, but this system would only work if the player controls one unit, well at least only work efficently if they own only 1 unit..
 
Level 13
Joined
Apr 13, 2008
Messages
1,427
Okay guys, why do you want to complicate it? Just use the custom unit value if you are not using it for anything. There is no need for other variables and unnecessary coding.
Also, Penguin Buddha, the World Editor help zone might be a more fitting place to post this, I don't know. If you want to learn JASS, I think you should start making incredibly simple triggers in GUI then convert them to custom text, modify them little by little and see how JASS works. After a few conversion go and read some tutorials and do some more advanced stuff. You should also get NewGen Pack for the syntax checker and stuff.
 
Top