Home   Help Search Login Register  

Author Topic: Scripting A Different Starting Position?  (Read 436 times)

0 Members and 1 Guest are viewing this topic.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Scripting A Different Starting Position?
« on: 28 Jul 2004, 00:53:17 »
All right. I have a mission where i need to have the enemy start at 4 different positions each time you reply the mission.

I have 3 enemy snipers all with names, that need to start at 4 different positions. I assume you can use Game logic some how. Not sure how to. If anybody could help me out that woudl be great. thanks.
Who's hyped for Arma4, long live Arma!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Scripting A Different Starting Position?
« Reply #1 on: 28 Jul 2004, 00:57:47 »
If you want a unit to start at one of several starting positions, chosen randomly, the easiest way is to place the unit at one location and put markers at the others.   Group (or is it synchro?  a thin blue line anyway) the markers to the unit.      Remember to make the markers invisible in your init.sqs

"marker1" setMarkerType "empty"

Syntax and details nnot guaranted but that's the principle.    If you want a whole group to start in a random place just do this for the leader and put the others in formation.
Plenty of reviewed ArmA missions for you to play

Cannon

  • Guest
Re:Scripting A Different Starting Position?
« Reply #2 on: 28 Jul 2004, 01:07:41 »
Hmm.. this might answer, but if you need them to start at different positions, you may want to check the placement radius option....

However, If the positions are fixed, you may want to teleport them to any of the positions with a random function at init. ^^ (providing that you know the positions, use an invisiblemarker)

Wow, I did not see McGuba post :)   He gotta group em with markers... and yes, it works like a charm, I just tried it (after making the random script on my own lol, which works too)



« Last Edit: 28 Jul 2004, 02:40:20 by Cannon »

Offline SEAL84

  • Members
  • *
  • Always lurking
Re:Scripting A Different Starting Position?
« Reply #3 on: 28 Jul 2004, 02:04:13 »
Macguba's solution works wonders....group the men to the empty markers and they'll start at the locations.

Just set the marker type to empty when you place them; that removes the need to do it in the init.sqs file.

You could also script it out the long way using an sqs file and game logics (generate random numbers and use if-then conditions to place the unit according to what value range you get), but it's far easier to do it with the empty markers.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Scripting A Different Starting Position?
« Reply #4 on: 28 Jul 2004, 09:30:19 »
I got that yonks ago from "Steal the car".   Just shows the value of unpboing BIS missions to learn from them.
Plenty of reviewed ArmA missions for you to play