OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Commando on 03 Apr 2005, 16:29:27

Title: choose road
Post by: Commando on 03 Apr 2005, 16:29:27
I tried earching around and also tried to look into the official mission Guardian on malden to find out how to make a truck stop and then give the player 2 radio options, like choose road south or road north.
anybody know how to do it?  :-\
Title: Re:choose road
Post by: 456820 on 03 Apr 2005, 16:53:38
first of all in the init.sqs file put
1 SetRadioMsg "NULL"
2 SetRadioMsg "NULL"
you could give it a waypoint then on the activation field put [] exec "radioscript.sqs"
then in that file put
1 SetRadioMsg "road south"
2 SetRadioMsg "road north"

then you must give the truck a do move command but im not to good with them
anyway i hope this helped im sure someone else can finish it off
Title: Re:choose road
Post by: macguba on 03 Apr 2005, 19:32:45
The radio triggers are type switch and are synchroed to waypoints.    So when you pick one, the trigger fires and the group is switched into the next waypoint.

Remember to set both radio channels back to "null" after one of the triggers has fired.
Title: Re:choose road
Post by: Commando on 05 Apr 2005, 04:24:01
you can't post a little pick macguba?  :-[
i got the part with init.sqs file or is it a seperate script, the null radio messages?
i can't figure it out where to switch what waypoints and the stuff :P
Title: Re:choose road
Post by: Blanco on 05 Apr 2005, 05:43:49
When you syncronise 2 (SWITCHED) radiotriggers with a waypoint, you will have to click both radiotriggers before the truck moves on.
Also you can't split waypoints, but you can move them.

I should do it like this :

1- make an init.sqs with

Code: [Select]
1 SetRadioMsg "NULL"
2 SetRadioMsg "NULL"
radio = false

That's the only script you'll need.

In the editor :

1 - Place your vehicle, name it (eg : truck), move in the player and his group.
2 - Give the truck 3 waypoints :
One at the crossing (MOVE), one wherever you want (MOVE) and one at the extraction point. (GETOUT or TRANSPORT UNLOAD)
In the condition field of the waypoint at the crossing :
Code: [Select]
radioOnactivation field :
Code: [Select]
1 SetRadioMsg "NULL";2 SetRadioMsg "NULL"3- Place a small trigger WEST/EAST,dunno what's your side..... detected,once; just before the crossing , in the onactivation field :
Code: [Select]
1 SetRadioMsg "road south";2 SetRadioMsg "road north"...so the radio messages will be available when you approach the crossing.
4- Group that trigger with the truck.
5- Click on "View ID" and zoom in. Find an ID on a road in the north and one in the south and write it down somewhere : eg: (8778 for south, 21564 for north)
6- place two radio triggers (Alpha and Bravo)
In onactivation field of the Alpha trigger (South):
Code: [Select]
radio = true;[group truck,2] setWPpos (getpos object 8778)onactivation field of the Bravo trigger (North)
Code: [Select]
radio = true;[group truck,2] setWPpos (getpos object 21564)
Voila, that's all I think. There could be an easier way but I can't find one atm.
Not tested btw.
The truck will stop at the second waypoint, because he will wait untill radio is true. When you use your radio, the third waypoint will be setposed at one of the ID positions and the radiomessages disappear.