Home   Help Search Login Register  

Author Topic: Condition of presence  (Read 526 times)

0 Members and 1 Guest are viewing this topic.

Offline DarkAngel

  • Members
  • *
  • The night is my friend.
    • DarkAngels Missions
Condition of presence
« on: 12 Apr 2004, 12:25:23 »
Hey guys,

I'm working on a mission where you have to locate an NVA base and want to set the possibility of the base being at a number of possible locations.

In init.sqs I use the following:

basecheck = random 100
?basecheck <25: basepos1=true
?basecheck >=25 and basecheck <50: basepos2=true
?basecheck >=50 and basecheck <75: basepos3=true
?basecheck >=75: basepos4=true

I then want to use the "condition of presence" field to determine whether or not a unit is created. The problem is I've tried both using "basepos1" and "basepos1 = true" but even when basecheck is < 25 the units I want don't seem to be created. Anyone got any ideas?

Cheers
Dark
"Moondark" in Beta Testing

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Condition of presence
« Reply #1 on: 12 Apr 2004, 14:34:30 »
alive basepos1

Not guaranteed though...  :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:Condition of presence
« Reply #2 on: 12 Apr 2004, 14:44:22 »
sounds like the "condition of presence" is being checked before the init.sqs is being run

Offline DarkAngel

  • Members
  • *
  • The night is my friend.
    • DarkAngels Missions
Re:Condition of presence
« Reply #3 on: 12 Apr 2004, 17:04:49 »
Cheers guys. Pablo, you may well be right - although I thought the point of init.sqs is that it happens before anything else...

What I'll do instead is put all the base objects in an array and deletevehicle them as appropriate. That should work.

"Moondark" in Beta Testing

Offline DarkAngel

  • Members
  • *
  • The night is my friend.
    • DarkAngels Missions
Re:Condition of presence
« Reply #4 on: 12 Apr 2004, 17:50:27 »
Right, now my init.sqs looks like this:

; Initialise Support Pack   
[] exec "\SnySptPack\init.sqs"

;hide markers
"markbasepos1" setmarkerpos [-100,-100]
"markbasepos2" setmarkerpos [-100,-100]
"markbasepos3" setmarkerpos [-100,-100]

;Establish arrays.
;Array POS1
pos1bunkerarray = [pos1bunker1, pos1bunker2, pos1bunker3, pos1bunker4, pos1bunker5, pos1bunker6, pos1bunker7, pos1bunker8, pos1bunker9, pos1bunker10, pos1bunker11, pos1bunker12]
pos1truckarray = [pos1truck]
pos1barrelarray = [pos1barrel1, pos1barrel2, pos1barrel3]
pos1ammoarray = [pos1ammo1, pos1ammo2, pos1ammo3, pos1ammo4, pos1ammo5, pos1ammo6, pos1ammo7, pos1ammo8, pos1ammo9]
pos1mgarray = [pos1mg1,pos1mg2]
pos1bunkerguys = [pos1bunkerguy1, pos1bunkerguy1_1, pos1bunkerguy1_2, pos1bunkerguy1_3, pos1bunkerguy1_4, pos1bunkerguy1_5, pos1bunkerguy1_6, pos1bunkerguy1_7, pos1bunkerguy1_8, pos1bunkerguy1_9, pos1bunkerguy1_10, pos1bunkerguy1_11]

pos1array = pos1bunkerarray + pos1truckarray + pos1barrelarray + pos1ammoarray + pos1mgarray + pos1menarray + pos1bunkerguys

;Set position of NVA base and delete as appropriate.
basecheck = random 100
?basecheck <33: goto "basepos1"
?basecheck >=33 and basecheck <66: goto "basepos2"
?basecheck >=66 and basecheck <100: goto "basepos3"

#basepos1
basepos1 = true

goto "next"

#basepos2
basepos2 = true
"deletevehicle _x" foreach pos1array
goto "next"

#basepos3
basepos3 = true
"deletevehicle _x" foreach pos1array
goto "next"

#next
exit

Now, this ought to delete all the objects in pos1array, but for some reason it's stopped doing that. Any ideas why?
"Moondark" in Beta Testing

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Condition of presence
« Reply #5 on: 12 Apr 2004, 23:17:07 »
sorry for not having read through your script yet, but
i'd just like to suggest you what:

Let's say you create a soldier (group leader) and give him
a name: gl1

Now you set his probability of presence to 50%

Then you create all other guys for his group, and into their
condition of presence field you type: alive gl1

This will give you a 50/50 chance for the entire group to be
there or not.

:note - condition of presence field gets executed before
the briefing screen, hell in multiplayer even before the
player selection screen.

Also take care that if you make a condition of presence,
the required unit needs to be created in the editor before
the other units.

What i mean is: if you create the groupleader first, followed
by his other guys, the groupleader will be the first unit on
the map. So take care that in case units will be only there upon
the presence of another unit, that this other unit is created
before.

hope this helps you a bit

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline DarkAngel

  • Members
  • *
  • The night is my friend.
    • DarkAngels Missions
Re:Condition of presence
« Reply #6 on: 13 Apr 2004, 00:41:19 »
Right, that explains it. Thanks Mr Death!

I've changed tack a bit and now I'm doing this rather clunky thing with arrays and deletevehicle - loads of boring typing but it seems to be getting the job done.

Thanks for all your help guys.

Dark.
"Moondark" in Beta Testing