Jump to content
Sign in to follow this  
Doolittle

Trigger setpossin'?

Recommended Posts

setPos an object in multiplayer and it moves for every client.

setMarkerPos a marker in multiplayer and it only moves the marker on the client that ran the command.

setPos a TRIGGER in multiplayer and...?? Does it move it for everyone?

Doolittle

Share this post


Link to post
Share on other sites

I'm almost positive it would move for everyone. The reason being a triggers seem to have alot of the same properties as objects...eg. you can get their position with the getpos command and move them with the setpos command. Also, you can camcreate and createvehicle triggers just like other objects.

Never tried it though. rock.gif

Share this post


Link to post
Share on other sites

wow_o.gifwow_o.gifwow_o.gif

WHAA? You can createvehicle triggers? With what names are the different trigger types created? I would change all my scripts if I knew how to do this. I don't believe it though. How can you set the sizes of triggers in game? There is no settriggersize and camcreate&createvehicle don't allow options like createunit does. I can't believe it.

Oh I agree triggers are moved on all clients.

Share this post


Link to post
Share on other sites

you can only create them. You can't modify their properies at all. Camcreating them is usefull for getting height ASL.

see this for an example.

Share this post


Link to post
Share on other sites

Thanks toadlife..!

Hmmm.  "emptyDetector", eh?  I wonder what its default settings are...radius, etc.

Doolittle

P.S.What's with everyone and checking stuff to "scalar bool array string 0xfcffffef" to see if it has been initialized???  I don't understand how this could possibly even work since you are comparing to a string.  I don't know of ANY way to see if a variable has been initialized or not.

Share this post


Link to post
Share on other sites

Doolittle - could objnull maybe help ya here?

objNull

Type of returned value:

   Object

Description:

   non-existing object. This values is not equal to anything, even to itself.

Example:

   player == objNull , result is false

and:

isNull obj

Operand types:

   obj: Object

Type of returned value:

   Boolean

Description:

   Check if value is equal to ObjNull. Note: a==ObjNull does not work, because ObjNull is not equal to anything, even to itself.

Example:

   isNull objNull , result is true

~S~ CD

Share this post


Link to post
Share on other sites

True....but I mean stuff like:

?_westscore == 4 : hint "mooooo"

Well if _westscore wasn't even initialized then...it won't even do the compare.

Doolittle

Share this post


Link to post
Share on other sites
Quote[/b] ]Variables

   Variable must be inicialized before being used. When any uninitialized variable is detected in any expression, the whole expression results nil (undefined value). When undefined value is encountered in field where boolean value is expected, it is converted to false. Variable may be unitialized by assigning it nil value. This effectively destroys variable as if it never existed.

Well, then i guess a non-initialized variable will return false

?!(_westscore) AND !(_westscore >= 0): hint "you bugger go and define _westscore"

See if that works

:edit - wait, just testing it - doesn't work like above - will be

back with more later ;)

OK, i could finally get it to work:

The example above didn't work, because as you already said

above, if it's not defined, it will even not compare it.

And because i made a mixture of checking for false AND for

any value, it didn't work.

I've made a work-around now, which finally gave me the hint

message, i expected to get:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

?!(_westscore): goto "check_it"

#check_it

?(_westscore >= 0): goto "skip_bug"

?(_westscore <= -1): goto "skip_bug"

hint "you bugger go and define _westscore"

exit

#skip_bug

hint "_westscore has been defined properly"

exit

The only problem now is: if _westscore is defined correctly,

a little errormessage pops up:

'!(_westscore|#|: Error !: type number, expected bool'

But the other part of the detection still works fine

~S~ CD

Share this post


Link to post
Share on other sites

If you use the format command on an unitialised vairable it retuns the string "scalar bool array string 0xfcffffef"

?((Format ["%1",_westscore]) == "scalar bool array string 0xfcffffef") : Format ["%1",hint "meow"]

If you use the format command on a variable thats has been used, then set to nil. Cant remember exactly, but it returns something like "<Null>"

You can do the same with null objects:

?(Format["%1",_Target]!="<NULL-object>")

Or dead people:

?(Format["%1",Name _Target])=="Error: No unit"

Most of the time you dont need to do this with null or dead objects, but there are times when it has come in handy.

Edit: To tie it in with your init event question, you can use the test on initialised variables to avoid calling the code in your config.cpp init event a second time. When a unit exits a vehicle.

Share this post


Link to post
Share on other sites

Ok we know how to check for nil variables, but doesn anyone have a defintive answer for doolittles original question? Like I said, I think it would work, but it would be nice to KNOW for sure. This would be a good FAQ item for the Ed Depot.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×