OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Whitsel on 19 Apr 2008, 01:48:34
-
Hey, guys. I am trying to create a trigger in the editor to make units surrender. I have got the activation line just the way I want it but the damn condition line factors keep giving me trouble and I dont understand the refferences people have sent me to read up on so I am just going to post my Q here and hope somone can tell me the correct layout.
I keep trying to add a random factor but I put this "random 1 <=0.3" and I can preview the thing a thousand times and every single time they perform the action! I want the condition to read the alive units like this "{alive _x} count thislist <=0.5" and it doesnt work, I can put the same thing with ">=0.5" and they perform the action but I dont want it to be read as 'more than or equal to'. Finally, can somone give me the exzact layout as to how I put this into my cond. line so there is no doubt it will work right? Thanks In Advance Anyone!
-
This is a shot from the hips:
{alive _x} count thislist < 5 + round(random 5)
Actually i don't know if this is valid. It should fire the trigger if there's between 5 and 10 units alive. Give it a try, nothing to lose. :D
-
Well its basicly doing the same thing as mine. The units surrender everytime, funny thing is there was only two of them. Lol
I am sure I can get the thing working on my own if somone could explain to me why when I put "random 1 < 0.1" they surrender every single time?!?!? Am I typing something wrong here?
-
Try count units thislist? :dunno:
-
The only thing I cant get working is "random".
I put all kinds of variables for it and nothing changes, but when I type like "random 1 <= 0.1" then they take like 30 seconds before the surrender. Putting it like "random 1 <= 1" they surrender immediatley, WTF?
-
random 1 will choose a random number between 0 and 1. if you say that that number has to be below or equal to 0.1 , "random 1 <= 0.1", as a condition before the trigger trips hence making the dudes surrender, then it may have to loop for say...30 seconds before it gets to 0.1
so random 1 selects a number between 0 and 1 which is always true if you say equal to or less than 1, "random 1 <= 1", so they always surrender immediately.
#EDIT: Don't quote the entire previous post you're replying to h-
-
okay, I am not 100% sure I understand what your saying there, lol. I am a pretty fresh newb to scripting/mission editing so if you could provide me with a condition ex. where they will perform the 'on act.' about 50% of the time or less then I could understand it better(usually just the way I learn new things). Thanks-
-
Triggers fire off or loop every second, so what he is saying is that it may take 30 times for the "random 1" to be < 0.1 and hence takes the extra time.
Try:
TRIGGER - OPFOR - PRESENT
Condition: this && (count thislist) > (5 + random 5)
OnAct: <Blah>
I don't think your going to get around your repeating loop. :no:
-
no-go. He nvr executes the command. Tried about 8 times in-a-row. I dont really want a cnt thislist code just yet, I would preffer to just get a random cond. working first then decide if i want cnt thislist/damage/flee or anything.
-
bump.
okay, i have looked everywhere and tried just about everything but cant seem to get this damn thing working so let me ask this instead...
in the cond. line I want to do like so...
((damage Grp1)>=0.1)
but i want grp1 to actually be 'thislist' or 'foreach thislist' or however its put. Similar to count thislist <= 2.
Also.... is there a command for counting the percent of men alive in a grp, area or side? I know the cnt alive command but i am unsure if it will count the percentage left of the starting/original number of men for a given team.
-
Theres no way to check if a group has lost a percentage of units unless a onitial integer is stored earlier on to compare it with. However you could just do what we've done up above already for you, heres something I posted before, except a little more in tune with what your asking.
TRIGGER - OPFOR - PRESENT
Condition: this && (count thislist) < 4
OnAct: <Blah>
Also, don't post consecutively within a few days, you'll just be spanked by the moderators...
-
what about determining damage for each unit within a given side to activate the trigger?
also... what about making the count thislist similar to something like determining a number of groups? What I mean there is the trigger checking groups [Grp1, Grp2, Grp3 etc..] for less than or equal to only 1-3 men per each group before initializing the trigger for each group seperately? Is there a way to do that or would I just have to create a replicant trigger and change the name to w/e the group's name is?
-
bump.
:weeping:
You most definitely do not need to bump a topic after a few hours...... :no:
As Rommel pointed out, if you have something to add after a short period of time modify your post instead of 'replying to yourself'.