Jump to content
Sign in to follow this  
5133p39

cpp userAction on soldier, available in vehicle?

Recommended Posts

Is there a way of making a userAction, defined in config.cpp on soldier unit, to be available even after i get into any vehicle?

Share this post


Link to post
Share on other sites
Quote[/b] ]Is there a way of making a userAction, defined in config.cpp on soldier unit, to be available even after i get into any vehicle?

Not if you want the user action in the units config. Any actions you define for infantry, get left at location he boards the vehicle. Wierd I know, but you can still see the user action even though the unit is miles away.

You may have to use the addaction script command on the vehicle he gets into, and put up with it being available to everyone in the radius.

Share this post


Link to post
Share on other sites
You may have to use the addaction script command on the vehicle he gets into, and put up with it being available to everyone in the radius.

yeah, but i don't want this, the AddAction command is not worth of the additional strain (you need some script or trigger to add/remove the action depending on the distance becuase the default distance is too big, etc.).

At first i thought the option disappears because of the "position" parameter - i thought maybe when you get into the vehicle, your soldier looses his "roura" or "head" or any of the other things in "memory LOD" or wherever they are defined - maybe they aren't rendered because they aren't needed when in vehicle.

So i thought maybe there is something i can put into the "position" parameter, and that something will be available all the time no matter what. I tried the trial&error approach, i tried "this" or nothing at all, but maybe i am completely wrong, or it doesn't work this way.

Any ideas?

Share this post


Link to post
Share on other sites
Quote[/b] ]yeah, but i don't want this, the AddAction command is not worth of the additional strain (you need some script or trigger to add/remove the action depending on the distance becuase the default distance is too big, etc.).

If it's just for the player you can use the getin & out events to add and remove the action. You don't need triggers e.t.c But yeah AddAction is a bit to limited.

Quote[/b] ]At first i thought the option disappears because of the "position" parameter - i thought maybe when you get into the vehicle, your soldier looses his "roura" or "head" or any of the other things in "memory LOD" or wherever they are defined - maybe they aren't rendered because they aren't needed when in vehicle.

So i thought maybe there is something i can put into the "position" parameter, and that something will be available all the time no matter what. I tried the trial&error approach, i tried "this" or nothing at all, but maybe i am completely wrong, or it doesn't work this way.

Any ideas?

There is more info about the effect\problem here:

http://www.flashpoint1985.com/cgi-bin....t=49998

What kind of action is it? Is it added to one unit, lots, does it depend on other conditions?

Share this post


Link to post
Share on other sites
What kind of action is it? Is it added to one unit, lots, does it depend on other conditions?

it's just an action to turn on/off a detector, and should be available to the local player unit only (condition="this == Player").

I give up, i'll do it with the help of the addAction command.

Share this post


Link to post
Share on other sites

Well if it's just for the player to turn something on and off when he is in a vehicle then AddAction & RemoveAction should work fine.

When he is out of the vehicle you can resort back to using the config user actions.

Share this post


Link to post
Share on other sites
Well if it's just for the player to turn something on and off when he is in a vehicle then AddAction & RemoveAction should work fine.

When he is out of the vehicle you can resort back to using the config user actions.

i made it with the help of trigger which is checking whether the (Vehicle Player) is the same as the previous one.

When the vehicles differ, the action is removed from the previous vehicle and is added to the new one.

Share this post


Link to post
Share on other sites

If it is just for the player, then the radius of the action shouldn't matter at all.

Blanco made a great script (called "perma action" or something) that would always keep an action available to the player, even when he got in and out of vehicles. It was posted on ofpec, but if you IM him, he should have it. Anyway, your trigger might work just as well too.

---------------

Another, simpler, option might be to just use radio triggers instead of actions. These are always available to the player regardless of what vehicle they are in, and only take one trigger to set up.

Share this post


Link to post
Share on other sites
If it is just for the player, then the radius of the action shouldn't matter at all.

---------------

Another, simpler, option might be to just use radio triggers instead of actions. These are always available to the player regardless of what vehicle they are in, and only take one trigger to set up.

The most annoying problem was that the action disappeared when the player got into a vehicle. I was hoping there is some way which i overlooked, but nevermind, the trigger is solving this nicely.

-------------

It's for multiplayer mission, so the radio triggers are not the option, because you have no way to find out who triggered the 'action', which in conjunction with the fact the radio triggers are executing on all clients, renders them unusable for that particular task i needed.

- If you make radio trigger which is execing some script, and then you will use the radio action, the radio action is published to all computers which results in running the script on all computers - which is not good when you want the script to do something only for the player who activated the radio action (like turning on/off the "debris detector" - which is exactly what i needed it for).

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  

×