Jump to content
The Loot

Command Activation Behavior

Recommended Posts

I've made a radio command that switches the normal people out for ones with only vehicle call commands and then back again.

 

So far so good, but I'm having issues with when and how the command activates.

 

I'd like it to ONLY activate when pushing the command button (not when clicking on the caller, ground, another person, vehicle, or object), and only when the caller is playing an idle animation, since there's issues with them being in the middle of other things when trying to remove the old prototype.

 

One issue I've run into, though, is that when in an building interior, they get stuck and are unable to leave the building unless a vehicle is pulled up next to it. I'm guessing that's from them being created there without going through the door. Is there a way to fix that, or at least make the command not work when in a building?

 

Here's what I have for the script.

LARadio.rar

 

Link to comment
Share on other sites

I've tried to put the "Self Execute" and priority lines in there, but it always seems to keep it from activating at all.

 

I think I can manage the priority issue. For the value, lower is as it sounds?

 

Something like this for those two (unsure if ValidTargets is needed):

{PcmdRadio(){SetIcon("radio"); SetCursor("radio"); SetValidTargets(ACTOR_PERSON | ACTOR_HOUSE);    SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(1);}

Also, any idea on how to keep it from being useable unless the caller is completely idle, without equipment?

 

 

Edit: Ok, that line worked for keeping it from being any sort of default command.

{SetIcon("radio"); SetCursor("radio"); SetValidTargets(ACTOR_FLOOR | ACTOR_VIRTUAL); SetPriority(200);}

And that one let's me click on the ground to deactivate the mode. Awesome.

The change in priority also looks like it's solved the need to make sure they're idle, at least in some situations. I'll have to keep an eye on that.

 

Thanks Dyson. Can't wait to see what you guys have got stuffed into v3 in the near future.

Link to comment
Share on other sites

To disable the command at specific moments you will have to play with either the "bool CheckPossible" part (which greys out the command if returned false) or the "bool CheckTarget" (which can be used as an additional check) or even both.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...