Home   Help Search Login Register  

Author Topic: How to spawn an vehicle though an SQS-file?  (Read 1531 times)

0 Members and 1 Guest are viewing this topic.

Offline edgren

  • Members
  • *
How to spawn an vehicle though an SQS-file?
« on: 09 Jun 2008, 00:47:18 »
Hi!

I have some problems with the subject saying. Have typed player addVehicle Sedan; but I only get a error-message in the game. I guess that you already know what this message says ;) But how can I spawn a vehicle through a SQS-file? I can't find any example-code in the COMREF-pages.

Offline Rommel92

  • Members
  • *
Re: How to spawn an vehicle though an SQS-file?
« Reply #1 on: 09 Jun 2008, 03:52:49 »
Code: (SQS) [Select]
nul = "Sedan" createVehicle getPos player

Code: (SQF) [Select]
nul = "Sedan" createVehicle getPos player;

Code: (Trigger) [Select]
nul = "Sedan" createVehicle getPos player;

http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=c#86

http://community.bistudio.com/wiki/ArmA:_Vehicles

CreateVehicle not AddVehicle, nice try though.  :good:
« Last Edit: 09 Jun 2008, 03:56:12 by Rommel92 »

Offline edgren

  • Members
  • *
Re: How to spawn an vehicle though an SQS-file?
« Reply #2 on: 09 Jun 2008, 04:02:01 »
Hehe, thanks :) But I can't get in to my "newspawned" car :/ Why?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: How to spawn an vehicle though an SQS-file?
« Reply #3 on: 09 Jun 2008, 04:36:49 »
First you need to name the vehicle, instead of "nul" use something like car1:

Code: [Select]
car1= "Sedan" createVehicle getPos player;
Then you need to reveal it to yourself:

Code: [Select]
Player reveal car1
Now you should be able to get inside it right from the get-go :) Otherwise, just right-click on the car (the default key for "spotting") and the actions should show up soon enough. Basically what happens is that your character (Player) does not know the car exists yet, and needs a little while to figure it out - unless you reveal it to him, as showed.

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: How to spawn an vehicle though an SQS-file?
« Reply #4 on: 09 Jun 2008, 04:52:34 »
You can also createVehicle Array, using something like
Code: [Select]
;SpawnVeh.sqs
;place an invisible H pad on your map
;& name it SpawnPoint.
;Call the script via trigger using
;[] exec "SpawnVeh.sqs"

_veh = createVehicle ["car_sedan", position SpawnPoint, [], 0, "NONE"];
exit

useful when spawning aircraft in some situations
« Last Edit: 09 Jun 2008, 05:01:26 by Carroll »

Offline edgren

  • Members
  • *
Re: How to spawn an vehicle though an SQS-file?
« Reply #5 on: 09 Jun 2008, 05:47:01 »
First you need to name the vehicle, instead of "nul" use something like car1:

Code: [Select]
car1= "Sedan" createVehicle getPos player;
Then you need to reveal it to yourself:

Code: [Select]
Player reveal car1
Now you should be able to get inside it right from the get-go :) Otherwise, just right-click on the car (the default key for "spotting") and the actions should show up soon enough. Basically what happens is that your character (Player) does not know the car exists yet, and needs a little while to figure it out - unless you reveal it to him, as showed.

Good luck!

Wolfrug out.

Im spawning a car through addAction and Im just wonder how I can reveal the given car to a player through this?