The Loot Posted August 24, 2018 Report Share Posted August 24, 2018 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? Quote Link to comment Share on other sites More sharing options...
itchboy Posted August 24, 2018 Report Share Posted August 24, 2018 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. Quote Link to comment Share on other sites More sharing options...
Squad 65 Posted August 24, 2018 Report Share Posted August 24, 2018 Look at Jackson County @The Loot it has a few scripts that do that. Quote Link to comment Share on other sites More sharing options...
The Loot Posted August 24, 2018 Author Report Share Posted August 24, 2018 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. Quote Link to comment Share on other sites More sharing options...
Squad 65 Posted August 24, 2018 Report Share Posted August 24, 2018 ok Quote Link to comment Share on other sites More sharing options...
itchboy Posted August 24, 2018 Report Share Posted August 24, 2018 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. Quote Link to comment Share on other sites More sharing options...
The Loot Posted August 24, 2018 Author Report Share Posted August 24, 2018 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. 1 Quote Link to comment Share on other sites More sharing options...