Always active action

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
gugusm
Posts: 487
Joined: Mon Aug 22, 2005 1:16 pm
Location: Klucze, Poland
Contact:

Post by gugusm »

With reference to my previous topic:
I have group of thrall in my map and I made for them proximity and radius tests. I want them to back into their initial positions when not fighting. It works good with LEGI action, but how can I make it with TUNI and MOVE actions? A-Red proposed me to make LEGI action (it works) or make in my radius test "Activate on Failure" flag. I tried this (I link "Activate on Failure" with MOVE action), but it didn't work. I think the problem lies here:
When player forces are in the radius, thralls attacks. In the same moment, radius test checks if player forces are farther than radius, but the player forces are closer and thralls attacks. So, after fight thralls are just standing. Maybe it's possible to make an always active action. I mean, the radius tests are always active and always are checking if enemy is closer or farther than radius, even after fight. If something is unclear, please ask.
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

If you open an action, there's a menu that says "Deactivates:"
You can set it to Success, Failure, Execution (Success OR Failure), Trigger (I don't know what that is exactly), or Never. If you set your TUNI to deactivate never, you shouldn't have that problem. They're set to Success by default, so it would test continually until it actually finds units within the radius, and then it would just turn off.
gugusm
Posts: 487
Joined: Mon Aug 22, 2005 1:16 pm
Location: Klucze, Poland
Contact:

Post by gugusm »

Yeah, it works. Thanks.
User avatar
haravikk
Site Admin
Posts: 987
Joined: Mon Mar 22, 2004 12:56 pm
Location: Scotland

Post by haravikk »

A-Red wrote:If you open an action, there's a menu that says "Deactivates:"
You can set it to Success, Failure, Execution (Success OR Failure), Trigger (I don't know what that is exactly), or Never. If you set your TUNI to deactivate never, you shouldn't have that problem. They're set to Success by default, so it would test continually until it actually finds units within the radius, and then it would just turn off.
Although I've never had reason to use it, as I understand it on-trigger and on-execution will cause an action to consider success differently:

For example; you have a move action.
When set to on trigger, a success (for activates on success parameters) is simply having the subject of the action alive to be told to move in the first place, failure is if the unit doesn't exist, or some parameter is missing (ie the actual way-point).
When set to on execution, a success is having the unit reach it's destination, a failure is having the unit stop because it is stuck.

However, as with much scripting this rarely works as it should, it may however be useful if the circumstances are controlled well enough (ie the unit you're moving is uncontrollable to the player, and you know it won't be obstructed).
So on execution is having it follow through to a finish, on trigger is having the command issued correctly.
For many actions (such as tests) it is irrelevant.


Also, as a last note, if you are using several actions set to never deactivate (perhaps until some other action deactivates it) then you should incorporate delays, as these will reduce the chances of it causing issues.
Oh, and actually, for what you're doing you'd be better off using a Legion command, simply put the units you're controlling into Group actions, then create a Legion action to control them, it has parameters for maintaining position, and for detecting nearby enemies, it also tends to be more robust unless you need to test for additional things.
Being Haravikk gets you girls like these:
Image
gugusm
Posts: 487
Joined: Mon Aug 22, 2005 1:16 pm
Location: Klucze, Poland
Contact:

Post by gugusm »

So, in short, it's better to use LEGI actions?
Zeph
Posts: 1019
Joined: Wed Apr 13, 2005 4:57 pm
Location: Montreal

Post by Zeph »

if you are TehLazyâ„¢
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

Thanks Hara, I'd been wondering about that. That should help me solve the MOVE issues I've been having too.
User avatar
haravikk
Site Admin
Posts: 987
Joined: Mon Mar 22, 2004 12:56 pm
Location: Scotland

Post by haravikk »

gugusm wrote:So, in short, it's better to use LEGI actions?
Well, legions are well suited to what you're trying to do, however if what you're doing at the moment is a great way to learn so it's up to you. However, by the sounds of it you got your current solution to work, adding a legion instead would be better for efficiency and usually run better.
However, with individual actions you get finer control, for example if you wanted to add a dodge script so your thrall scattered from dwarven grenades or arrow volleys. Though with thrall that's probably redundant, dodging a thrall is steering a car without wheels :)
Being Haravikk gets you girls like these:
Image
Post Reply