OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: marcus3 on 16 Jan 2005, 22:27:05

Title: make cars appear
Post by: marcus3 on 16 Jan 2005, 22:27:05
ok now. i want it where when i radio alpha a car appears right beside me.
somebody know how to do this.
Title: Re:make cars appear
Post by: Planck on 16 Jan 2005, 22:35:55
Make your Radio Alpha trigger......

In the Activation field put:

fred = "nameofmysupercar" createvehicle getpos player

fred can be any name of your choosing, but the name in quotes must be the correct object name.



Planck
Title: Re:make cars appear
Post by: marcus3 on 16 Jan 2005, 22:39:10
it says "createvehicle" is un knowen
Title: Re:make cars appear
Post by: Planck on 16 Jan 2005, 22:50:08
What exactly are you typing in the On Activation field of your trigger?


Planck
Title: Re:make cars appear
Post by: marcus3 on 16 Jan 2005, 22:54:05
jason = "ferrari modena 360" createvehicle getpos player
and the same thing happens
Title: Re:make cars appear
Post by: Planck on 16 Jan 2005, 22:56:26
You need to find out the cars proper object name.

Look in its config.cpp.

As a test try this:

fred = "skoda" createvehicle getpos player


Planck
Title: Re:make cars appear
Post by: marcus3 on 16 Jan 2005, 23:09:49
ok i tried it and still says. un knowen opearator createvehicle. even with sportcar instead of skoda
i am playing opf ver 1.45 not res does that make a chang to things
Title: Re:make cars appear
Post by: Planck on 16 Jan 2005, 23:13:31
But...............I have just tried the very same thing ingame........it works perfectly.

The default cars in OFP have the following class names:

Skoda
SkodaRed
SkodaGreen
SkodaBlue
Rapid
RapidY

The OFP sports car is in fact "Rapid" and the yellow one is "RapidY".


Planck
Title: Re:make cars appear
Post by: marcus3 on 16 Jan 2005, 23:18:06
I am playing opf ver 1.45 not res does that make a chang to things.
Title: Re:make cars appear
Post by: Artak on 16 Jan 2005, 23:19:06
Note that the quotation marks need to be there when you write it in your trigger's on activation field.
fred = "skoda" createvehicle getpos player

Ah I see the version problem now. Try camcreate instead of createvehicle. camcreate should make the car totally useless though..
Title: Re:make cars appear
Post by: Planck on 16 Jan 2005, 23:22:54
It won't make a difference for the default OFP cars.......not too sure about the "Rapid" and "RapidY" though.

Also if the car you are trying is made for Resistance it might not work in 1.46.

However you will need to get the cars class name from the readme or config.


EDIT:  createVehicle is ok for version 1.46

Planck
Title: Re:make cars appear
Post by: Artak on 16 Jan 2005, 23:28:16
Quote
EDIT:  createVehicle is ok for version 1.46
not for my 1.46 it's not.  ;D
Title: Re:make cars appear
Post by: Planck on 16 Jan 2005, 23:36:06
Hmmmmm.........According to my comref it was introduced in version 1.34.


Have you tried it again recently Artak?


Planck
Title: Re:make cars appear
Post by: Planck on 16 Jan 2005, 23:42:01
Sorry Artak, but I just tried it in 1.46.......works ok here.

Try it again.


Planck
Title: Re:make cars appear
Post by: Triggerhappy on 17 Jan 2005, 00:35:21
well, seeing as marcus isn't typing in the config name of the vehicle, I'd say that's what his problem is....
Title: Re:make cars appear
Post by: Planck on 17 Jan 2005, 06:05:00
Quote
well, seeing as marcus isn't typing in the config name of the vehicle, I'd say that's what his problem is....

Yes, but he also said he couldn't get "skoda" to work either.

Unless he mistyped it.


Planck
Title: Re:make cars appear
Post by: Triggerhappy on 17 Jan 2005, 06:50:09
ah, i misread his post

maybe he is getting the syntax wrong

copy this exactly from the post:

tommy = "jeep" createvehicle [(getpos player select 0) + 10,getpos player select 1,0]


if that doesn't work then you won't be able to use createvehicle


Title: Re:make cars appear
Post by: Artak on 17 Jan 2005, 09:45:57
Yeah Planck, I just tried it earlier. That's why I was so sure to say the command wasn't working with 1.46  :o
Title: Re:make cars appear
Post by: marcus3 on 17 Jan 2005, 11:28:34
dang. i cant get it to work it says. "unknowen operator createvehicle"
so i guess i just need to wait for my copy of res to get here o well. thanks for your time.
Title: Re:make cars appear
Post by: THobson on 17 Jan 2005, 11:55:52
Creating things usually does work.  To get round this while you find a solution why not put the car on some offshore island and setPos it to where you want it when you want it to appear
Title: Re:make cars appear
Post by: Sui on 17 Jan 2005, 12:11:13
Quote
unit = "skoda" createvehicle (getpos player)

Curse of the missing brackets, maybe? ;)
Title: Re:make cars appear
Post by: marcus3 on 17 Jan 2005, 12:16:30
nope still dont work. thats crap my PC must be goofing up.dang. is there some other way to do this?
Title: Re:make cars appear
Post by: THobson on 17 Jan 2005, 12:56:36
You maybe missed my earlier post

Quote
Creating things usually does work.  To get round this while you find a solution why not put the car on some offshore island and setPos it to where you want it when you want it to appear
Title: Re:make cars appear
Post by: MachoMan on 17 Jan 2005, 16:24:32
yep THobson is right, setPos is the way to go. I remember quite surely, cause I used that trick quite a lot in those days.
Title: Re:make cars appear
Post by: marcus3 on 18 Jan 2005, 00:26:21
ok i tried the setPos thing and no go. how do you do it the right way i put in the A field.
Car setPos Jason
and some junk comes up on top.
Title: Re:make cars appear
Post by: THobson on 18 Jan 2005, 00:41:28
jason is a unit not a position.

car setPos getPos jason
would put the car on top of jason

car setPos [(getPos jason select 0)+5*sin(getDir jason),(getPos jason select 1)-5*cos(getDir jason),0]

would put the car 5 meters to jason's right.

Bye the way it is not junk.  Find the #and that is where the error is.  The text tells you what the error is.
Title: Re:make cars appear
Post by: marcus3 on 18 Jan 2005, 02:29:09
ok its not junk sorry. that works but then i cant get in the car. that sucks some way to fix that???
Title: Re:make cars appear
Post by: Triggerhappy on 18 Jan 2005, 02:52:18
unlock it

when you place it it has the option of having it locked (don't lock it and there you go)
Title: Re:make cars appear
Post by: marcus3 on 18 Jan 2005, 03:09:37
ok is working now. (i gotta quit drinking befor i play) kidding ;D
but all is as i wood like it do be so everbody. your dumb. kidding.
thanks