Home   Help Search Login Register  

Author Topic: can a script be executed with an object number instead of its name?  (Read 977 times)

0 Members and 1 Guest are viewing this topic.

Offline FiLL2d

  • Members
  • *
  • X.x
can a script be executed with an object number instead of its name?

or did they stop this in 1.85 due to setpos cheating?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
no idea, but scripts can be called with anything in the execution array field -

Code: [Select]
[12345] exec "script.sqs"
then in the script _this select 0 points at '12345' which can be used as an object id...

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Or alternatively, if you have only one argument to pass to the script:

Code: [Select]
12345 exec "script.sqs"
Then in the script _this will point at '12345'.

...but I bet this wasn't what you needed to know. Could you clarify your question a bit?
« Last Edit: 10 Sep 2005, 12:46:33 by Baddo »

Kyle Sarnik

  • Guest
can a script be executed with an object number instead of its name?

or did they stop this in 1.85 due to setpos cheating?

Are you reffering to objects on the island? If so, you simply use object ID#. If you are talking about the ID of objects placed in the editor, then no, not if you type them in yourself, you have to "get" them first be assigning them to a variable, which really is what you are doing when you give objects names. So if that is your question then no.

Offline FiLL2d

  • Members
  • *
  • X.x
yes like 12345 exec "addon\script.sqs"
instead of unit exec "addon\script.sqs"

Kyle Sarnik

  • Guest
First I must ask... why? And second, no, because like I explained, units don't have a simple ID number that will work if you type somewhere, no, it works like setpos and getpos. If you want to setpos something, you first need to getpos the position (ignore the fact that you can use an array). So the only way to get a units ID is to assign it to a variable (for example, Soldier1 = this) which is the exact same thing as giving it a name.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
I suspect FiLL2d is referring to .wrp placed objects, in which case you would need to use (object xxxx).

However .wrp placed objects cannot be setpos'ed anywhere AFAIK, all you can do is destroy them.


Planck
I know a little about a lot, and a lot about a little.

Kyle Sarnik

  • Guest
I suspect FiLL2d is referring to .wrp placed objects, in which case you would need to use (object xxxx).

However .wrp placed objects cannot be setpos'ed anywhere AFAIK, all you can do is destroy them.


Planck

I know that, I was refering to editor placed objects, cause I thought he was. I just thought FiLL2d doesn't know that units don't actualy have ID's. Well I don't know, FiLL2d could you be more specific? What exactly do you mean?