Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
  • Announcements

    • randomperson139

      Signatures   03/04/2016

      Hi everyone. It appears that the update to the new forum has affected the format of the majority of signatures (adding extra spaces, changing sizes etc.). Due to this, could everyone please check their own signature, ensuring that it complies with the site rules. See the http://www.emergency-planet.com/tos.html/ or http://www.emergency-planet.com/topic/16848-acceptable-signature-sizes/ for more information.  We'll give it a few weeks to give enough time to edit signatures, after that the unnecessarily large signatures will simply be removed. Thanks for your cooperation. Regards, EMP Staff.
Sign in to follow this  
The Loot

Carrying Over Command Position From One Script Activation To Another

Recommended Posts

Basically, I'm trying to add a delay when I use a modified LA Call Vehicle Command, so that there's a wait period during the radio audio, and a vehicle behind chosen and taking actions itself.

Vector CmdPos = Game::GetCommandPos(); is outside of Child sections at the top of the script.

Under ChildID 0, I have tried both of these commands: 

Caller->PushActionExecuteCommand(ACTION_APPEND, "PcmdCallALSAmb", CmdPos, 1, false); - It throws this error log:

Spoiler

?(_LACall_EMS873d0): Error: Can't call Person::PushActionExecuteCommand(ACTION_APPEND,"PcmdCallALSAmb",CmdPos,1,false) in current scope
?(_LACall_EMS873d0):  FILE:mod:/scripts/game/command/LACall_EMS.script873d0 LINE:107
?(_LACall_EMS873d0): Possible candidates are...
?(_LACall_EMS873d0): filename       line:size busy function type and name  
?(_LACall_EMS873d0): (in Person)
?(_LACall_EMS873d0): filename       line:size busy function type and name  
?(_LACall_EMS873d0): (in GameObject)
?(_LACall_EMS873d0): (compiled)        0:0    0 
?(_LACall_EMS873d0): public: 
?(_LACall_EMS873d0): void 
?(_LACall_EMS873d0): PushActionExecuteCommand(
?(_LACall_EMS873d0): ActionInsertMode
?(_LACall_EMS873d0):  Mode_
?(_LACall_EMS873d0): ,
?(_LACall_EMS873d0): const char*
?(_LACall_EMS873d0):  Command_
?(_LACall_EMS873d0): ,
?(_LACall_EMS873d0): Actor*
?(_LACall_EMS873d0):  Target_
?(_LACall_EMS873d0): =NULL
?(_LACall_EMS873d0): ,
?(_LACall_EMS873d0): int
?(_LACall_EMS873d0):  ChildID_
?(_LACall_EMS873d0): =0
?(_LACall_EMS873d0): ,
?(_LACall_EMS873d0): bool
?(_LACall_EMS873d0):  CheckTarget_
?(_LACall_EMS873d0): =true
?(_LACall_EMS873d0): )
?(_LACall_EMS873d0): ;
?(_LACall_EMS873d0): 
?(_LACall_EMS873d0): (compiled)        0:0    0 
?(_LACall_EMS873d0): public: 
?(_LACall_EMS873d0): void 
?(_LACall_EMS873d0): PushActionExecuteCommand(
?(_LACall_EMS873d0): ActionInsertMode
?(_LACall_EMS873d0):  Mode_
?(_LACall_EMS873d0): ,
?(_LACall_EMS873d0): const char*
?(_LACall_EMS873d0):  Command_
?(_LACall_EMS873d0): ,
?(_LACall_EMS873d0): Vector&
?(_LACall_EMS873d0):  Pos_
?(_LACall_EMS873d0): )
?(_LACall_EMS873d0): ;
?(_LACall_EMS873d0): 
?(_LACall_EMS873d0): filename       line:size busy function type and name  
?(_LACall_EMS873d0): (in Actor)
?(_LACall_EMS873d0): Error: Failed to evaluate class member 'PushActionExecuteCommand(ACTION_APPEND,"PcmdCallALSAmb",CmdPos,1,false)' (p.PushActionExecuteCommand(ACTION_APPEND,"PcmdCallALSAmb",CmdPos,1,false))
?(_LACall_EMS873d0): Possible candidates are...
?(_LACall_EMS873d0): filename       line:size busy function type and name  
?(_LACall_EMS873d0): 
?(_LACall_EMS873d0): !!!Dictionary position rewound... 
?(_LACall_EMS873d0): !!!Error recovered!!!

Caller->PushActionExecuteCommand(ACTION_APPEND, "PcmdCallALSAmb", CmdPos.Target, 1, false); - Saw something like that in the Move command, but it throws this much smaller error log:

Spoiler

?(_LACall_EMS87452): Error: Failed to evaluate class member 'Target' (CmdPos.Target)
?(_LACall_EMS87452): !!!Dictionary position rewound... 
?(_LACall_EMS87452): !!!Error recovered!!!


ChildID 1 contains the actual bulk of the script.

Is this even possible?

Share this post


Link to post
Share on other sites

CmdPos is not considered a valid target in Em4. You need to use an actual gameObject as the target so that the script doesnt crap out.

Share this post


Link to post
Share on other sites
2 hours ago, itchboy said:

CmdPos is not considered a valid target in Em4. You need to use an actual gameObject as the target so that the script doesnt crap out.

I suppose it's the method that complicates using a vector in this case, but I've seen them used in seemingly similar ways elsewhere.

1 hour ago, Squad 65 said:

Look at Jackson County @The Loot it has a few scripts that do that.

That mod seems to have some gameplay elements I've gone for myself, so I'll probably check it out in general now.

Share this post


Link to post
Share on other sites

The way I would do it is create a gameObject as the target. This gO must be positioned at the point where the user clicks, so using the "GetCommandPos" line works.

From there you have a permanent (or temporary, your choice) variable that you can extract a user set position from.

Share this post


Link to post
Share on other sites

Alright, finally got it working.

The caller creates a copy of themselves at the command position, it gets hidden (normal method caused an issue with getting a final vector, changing model to an invisible one works), find it with another caller command, make it execute the final command at its position, and then delete itself. I was going to just use an empty object prototype, but the prototype of the caller is essential to the functioning of the scripts.

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×