Home   Help Search Login Register  

Author Topic: Opening Gates Using Scripts  (Read 3281 times)

0 Members and 1 Guest are viewing this topic.

Alex

  • Guest
Opening Gates Using Scripts
« on: 31 Aug 2004, 09:10:57 »
Hey All, I Am Making A Mission Using  The FDF Mod And My Journey Takes Me To A Gate In Maldevic, How Do I Get It So That As The Truck, (AI Controlled) Rolls Up To The Gate It Stops And The Guard At The Gate Opens The Gate?
Thanks,
Alex

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Opening Gates Using Scripts
« Reply #1 on: 31 Aug 2004, 09:18:29 »
Assuming that gate is capable of opening, it will be something like this:   group the trigger to the truck for new activation box options.

Activation box:  vehicle present
On Activation:   gate1 animate ["doors1", 1]

If you want it to look better you could add commmands for the guard to walk over to the gate and do a playMove animation.    Also you many need commands to control the truck stopping and starting again:  it might just be easier to open the gate far enough ahead so he doesn't have to stop.   Remember to close the gate after him.
Plenty of reviewed ArmA missions for you to play

Alex

  • Guest
Re:Opening Gates Using Scripts
« Reply #2 on: 31 Aug 2004, 17:37:11 »
Sorry, Can You Go Step By Step Plz?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Opening Gates Using Scripts
« Reply #3 on: 31 Aug 2004, 18:06:35 »
What Macca there forgot is that you cannot name the gates in a map as they are placed there when the island was made... ::)
So you would need to use the command object and the gate's ID number instead (attained via using the 'show IDs' button in the mission editor)...

Unfortunately, things are not as simple as that with Maldevic...
A bug in Visitor (if I remmeber correctly) screwed up the object IDs in Maldevic so you will need a more complicated way of opening the gate...

I explain the opening method here, Macca can explain the rest as he does so much better job in it than I would :)

First, create a game logic near the gate and name it to something like gate_keeper_1 or something (can be what you want it to be...)
then, in the trigger which Macca already described above use this instead:
(nearestObject [gate_keeper_1,"FDFrajapuomi"]) animate ["keppi",1]
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Opening Gates Using Scripts
« Reply #4 on: 31 Aug 2004, 18:36:17 »
The first thing is to make the gate open.    

Check the commmand reference and learn about the commands nearestObject and animate before doing anything else.

Now make a new test mission.   Place the player unit near the gate you want to open.    Follow HateR_Kint's advice and place a gamelogic right on top of the gate.    Name it gate_keeper_1.

Now create a trigger like this:-

Area:   50 x 50
Activation box:  whatever
Countdown:    3       3      3
Condition:   true
On activation:     (nearestObject [gate_keeper_1,"FDFrajapuomi"]) animate ["keppi",1]

(I'm not familiar with this island but I presume we know that FDFrajapuomi is a gate that can open and keppi is the magic spell that opens it.)

Right, now test the mission.   Look at the gate.   3 seconds after the mission starts the gate should open.

Lets assume that works.

Now create a truck with driver, say 200m away.   Give him a move waypoint just in front of the gate.      Now move the trigger over the gate area:  make it smaller, say 10x10 - you'll have to experiment to get the right size.      Hit F2 and drag and drop a blue line from the trigger to the truck.    Open the trigger and edit it like this:-

Area:   10x10
Activation box:    Vehicle present
Countdown:    3       3      3
Condition:   this
On activation:     (nearestObject [gate_keeper_1,"FDFrajapuomi"]) animate ["keppi",1]

Now watch the truck drive up to the gate and stop:  watch the gate open.

Now, back to the mission editor and give the truck a second move waypoint, 200m past the gate.     Open his first waypoint and change the timeout fields to 10  10   10.   Test again:  this time he should wait for the gate to open, then drive through.

Now go back to the trigger.     Place it very close to the gate, so that the area on each side of the gate is about the same.     Add this to the trigger:-

On Deactivation:    (nearestObject [gate_keeper_1,"FDFrajapuomi"]) animate ["keppi",0]

Now add a sentry standing beside the gate.     Preview the mission and admire your handiwork.

I just hope it works.  :P

These are very detailed instructions so I've probably forgotten something.    Follow them carefully, but at each point think about what you are doing and make sure you understand it.    You may have to change some of the instructions to make it work:  experiment!

We'll worry about making the guard do stuff later.
« Last Edit: 31 Aug 2004, 18:38:40 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Opening Gates Using Scripts
« Reply #5 on: 31 Aug 2004, 18:52:00 »
Quote
FDFrajapuomi is a gate that can open and keppi is the magic spell that opens it.
'keppi' is actually the animated arm on the gate... The magic spell opening it is 1, and closing it 0... :P (*picks a nit*)

('keppi' translates to english as 'stick'... :P like somebody cared ::) )
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Alex

  • Guest
Re:Opening Gates Using Scripts
« Reply #6 on: 31 Aug 2004, 19:31:09 »
IT WORKS!!! THANKS GUYS! How Can I Get An Empty Vehicle To Explode As Soon As The Game Starts??

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Opening Gates Using Scripts
« Reply #7 on: 31 Aug 2004, 21:49:36 »
 :D Good!

Set its health slider to 0.
Plenty of reviewed ArmA missions for you to play

Alex

  • Guest
Re:Opening Gates Using Scripts
« Reply #8 on: 31 Aug 2004, 21:54:49 »
Lol! I've Tried!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Opening Gates Using Scripts
« Reply #9 on: 31 Aug 2004, 21:58:35 »
Have you tried

this setdammage 1

in the vehicle's initialisation field?
« Last Edit: 31 Aug 2004, 21:59:46 by THobson »

Alex

  • Guest
Re:Opening Gates Using Scripts
« Reply #10 on: 31 Aug 2004, 22:07:40 »
Yeah.... I've Tried But With FDF Mod When Vehicles Are Destroyed They Burst Into Flames, But On Set Dammage 1 And Health slider to 0 It Doesn't.... :Edit, I Wan't it To Catch Fire.....
« Last Edit: 31 Aug 2004, 22:08:33 by Alex »

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Opening Gates Using Scripts
« Reply #11 on: 31 Aug 2004, 22:11:05 »
setdammage 4? get a hidden guy to shoot it? fire script? a combination of these? One might work.  ;)

Alex

  • Guest
Re:Opening Gates Using Scripts
« Reply #12 on: 31 Aug 2004, 22:12:21 »
Where Would Be A Good Fire Script Mate?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Opening Gates Using Scripts
« Reply #13 on: 31 Aug 2004, 22:13:31 »
Failing any of these try camcreate a shell or two at the vehicle's location

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Opening Gates Using Scripts
« Reply #14 on: 31 Aug 2004, 22:15:38 »
Try something like this.

Put

this exec"VehicleSmoke.sqs"

in the vehicle's init field
« Last Edit: 31 Aug 2004, 22:17:56 by THobson »