Jump to content
Sign in to follow this  
AAD10 Pete

Only player can activate a trigger? - Call Object with its Name as string?

Recommended Posts

Hi at all

Meanwhile I'm getting closer to the scripting thing. Thanks to the editing guide ;-)

But for two important aspects I found no answers so far.

1.

How do I have to prepaire a trigger in a way that only the player can activate him? I know how to sort out the activation code, that it has only an effect for the local player but I don't know what to write into the condition field that only the local player can activate the trigger. If I write the following, it doesn't work: Condition: this && (local player);

With this line, still all units of the whole own group can activate the trigger...

2.

How can I call a (vehicle)object by its name as string? Is there a scripting command therefor?

That works:

deleteVehicle ObjName;

That doesn't work:

ObjNameStr = format["%1",ObjName];

deleteVehicle ObjNameStr;

How can I convert back an ObjectName as string to "something" that refers to the object?

Thanks for your help in advance!

Share this post


Link to post
Share on other sites

1) thislist select 0 == player

2) call compile format ["deletevehicle %1",ObjName];

Share this post


Link to post
Share on other sites

Is the player always a certain unit? Just make sure the unit is named.

condition:

this && unitname

as for the other.

ObjNameStr = call compile format["%1",ObjName];

deleteVehicle ObjNameStr;

heh shk beat me. :)

Share this post


Link to post
Share on other sites

For a specific group/unit, group the trigger with the group/unit (by choosing "groups" (F2) and dragging a line from the trigger to the group/unit), and then when you try to edit the trigger you will have some useful options that will make your life easier in a lot of cases ;)

If you want "only player to activate trigger" no matter what unit the player is playing, though, you will need to use player in thislist or something like that, but I doubt that was what you wanted to do.

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  

×