Home   Help Search Login Register  

Author Topic: Surrender trigger creation?  (Read 2175 times)

0 Members and 1 Guest are viewing this topic.

Offline Whitsel

  • Members
  • *
Surrender trigger creation?
« 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!

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Surrender trigger creation?
« Reply #1 on: 19 Apr 2008, 02:00:06 »
This is a shot from the hips:
Code: [Select]
{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

Offline Whitsel

  • Members
  • *
Re: Surrender trigger creation?
« Reply #2 on: 19 Apr 2008, 02:04:48 »
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?
« Last Edit: 19 Apr 2008, 02:41:34 by Whitsel »

Offline Rommel92

  • Members
  • *
Re: Surrender trigger creation?
« Reply #3 on: 19 Apr 2008, 09:18:56 »
Try count units thislist?  :dunno:

Offline Whitsel

  • Members
  • *
Re: Surrender trigger creation?
« Reply #4 on: 19 Apr 2008, 15:09:45 »
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?

Offline Sparticus76

  • Members
  • *
Re: Surrender trigger creation?
« Reply #5 on: 20 Apr 2008, 02:40:27 »
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-
« Last Edit: 20 Apr 2008, 08:28:47 by h- »

Offline Whitsel

  • Members
  • *
Re: Surrender trigger creation?
« Reply #6 on: 20 Apr 2008, 23:02:10 »
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-

Offline Rommel92

  • Members
  • *
Re: Surrender trigger creation?
« Reply #7 on: 20 Apr 2008, 23:21:53 »
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:

Code: (Between 5-10 units alive, exec code in OnAct.) [Select]
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:

Offline Whitsel

  • Members
  • *
Re: Surrender trigger creation?
« Reply #8 on: 21 Apr 2008, 01:19:21 »
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.
« Last Edit: 21 Apr 2008, 04:16:17 by Whitsel »

Offline Whitsel

  • Members
  • *
Re: Surrender trigger creation?
« Reply #9 on: 21 Apr 2008, 18:50:44 »
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.

Offline Rommel92

  • Members
  • *
Re: Surrender trigger creation?
« Reply #10 on: 21 Apr 2008, 22:15:43 »
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.

Code: ((Between 0-4 units alive, exec code in OnAct.)) [Select]
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...
« Last Edit: 21 Apr 2008, 22:17:28 by Rommel92 »

Offline Whitsel

  • Members
  • *
Re: Surrender trigger creation?
« Reply #11 on: 21 Apr 2008, 23:23:27 »
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?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Surrender trigger creation?
« Reply #12 on: 22 Apr 2008, 08:22:29 »
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'.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.