Home   Help Search Login Register  

Author Topic: How to name a "camcreated" object?  (Read 463 times)

0 Members and 1 Guest are viewing this topic.

Offline MIG

  • Members
  • *
  • Cuidado, estou de muito mau humor...
    • Operation Farmland
How to name a "camcreated" object?
« on: 07 Feb 2005, 10:53:34 »
I have created an object in a certain coordinate using the "createvehicle" command and i want to name it so it can perform a task defined in a script. Of course i could add the object directly in the mission and name it there and after that it could perform the task, but i don't want to make it that way. It has to be created or camcreated and then named. Is there any command to name a camcreated object in a mission?

Here a code sample of what i'm using:

Code: [Select]
_cord = [1121.944946,3956.699951,1]

_l = "elevator" createvehicle _cord

_l setdir 180.000000

;_l Name / Text is" "

_l exec "\fml_isleobj\scripts\start.sqs"
« Last Edit: 07 Feb 2005, 11:26:51 by MIG »

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:How to name a "camcreated" object?
« Reply #1 on: 07 Feb 2005, 13:18:07 »
Think you've already done it.

Not much experience of CreateVehicle, but if you CamCreate it the object would be named : _l.  If you need the name outside of the script make sure the name is a global variable (without the underscore).

One problem is that you are not passing an array to the script you're calling; _l is an object not an array.  Does this work any better:

Code: [Select]
_cord = [1121.944946,3956.699951,1]

_l = "elevator" CamCreate _cord

_l setdir 180.000000

;_l Name / Text is" "

[_l] exec "\fml_isleobj\scripts\start.sqs"

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:How to name a "camcreated" object?
« Reply #2 on: 07 Feb 2005, 15:23:56 »
Quote
One problem is that you are not passing an array to the script you're calling; _l is an object not an array.
There's no need to pass an array into a script...

You can use
[stuff]
stuff
"stuff"

when using [stuff] the stuff is called in the script by _this select 0
when using just stuff, it's called in the script by _this
Never really used "stuff" (only used it as an empty string when no arguments are passed in the executed script), but I would presume it's also called in the script by _this...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:How to name a "camcreated" object?
« Reply #3 on: 07 Feb 2005, 22:06:28 »
Yes, string arguments are also
Code: [Select]
_this.

Offline MIG

  • Members
  • *
  • Cuidado, estou de muito mau humor...
    • Operation Farmland
Re:How to name a "camcreated" object?
« Reply #4 on: 08 Feb 2005, 00:43:52 »
Thanks to all for the feedback :) I've tryed it and it starts the script. Only small prob: The player is performing the object movement  :D