Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
genesis92x

Removing AI from group/Removing action

Recommended Posts

Hello all, I got a mission where the player has a side objective. It goes as follows.

1) Players talks to soldier who tells them where a guy they have to rescue is.

2) Players find guy and recruit him into their group

3) Players bring back guy and 2 vehicles are unlocked for them.

4)The "Talk" action gets removed on the soldier. And the rescued guy gets removed from the players group. And the rescued guys action to recruit him gets removed too. This is what I'm having trouble with.

Lost1.sqs

(Vehicle player) in thislist
hint "Soldier: Hello, you look like you could use some fresh wheels. How about we make a deal?"
~5
hint "Soldier: I lost one of my friends in LANDAY, A group of militants took him hostage. His name is Derek"
~5
hint "Soldier: If you rescue him and bring him here, I can give you those two HMMWVS just right outside there. Deal?"

SoldierA init

Lost1 = this addaction ["Talk To This Soldier","Lost1.sqs"];this disableAI "move";

Rescue Init:

Rescue DisableAI "move";Rescue1 = this addaction ["Are you Derek?","Rescue1.sqs"];

Rescue1.sqs

private ["_obj","_caller","_id"]
_npc = _this select 0
_caller = _this select 1
_id 	= _this select 2

_npc removeAction _id
[_npc] joinSilent _caller
_npc addaction ["Leave Group", "Leave.sqs","Leave"]

(Vehicle player) in thislist
Hint "Derek: Yes! Yes! It's me! Thank God someone came to save me!"
_npc enableAI "move"

Trigger

Condition:

(Vehicle Rescue) in thislist

Act:

hint "Soldier: Ah! Thank you! The vehicles are yours!";HMMWV2 lock false;HMMWV1 lock false;this exec "Reward1.sqs";Rescue join grpNull;

Reward1.sqs

SoldierA removeAction Lost1
Rescue join GrpNull

So to repeat, I have the skeleton of the scripts down. I just need to find a way to remove an action and how to remove an AI from the players group!

Any help is muchly appreciated!

Edited by Genesis92x

Share this post


Link to post
Share on other sites

I'm not sure about remove action, I normally use a distance value to initiate talking etc

To remove an AI from the players group I simply make the AI unit join a different group.

Share this post


Link to post
Share on other sites
I'm not sure about remove action, I normally use a distance value to initiate talking etc

To remove an AI from the players group I simply make the AI unit join a different group.

yeah, under reward1.sqs I have rescue join grpnull but it doesn't seem to want to work.

Rescue is the civilian you have to rescue

Share this post


Link to post
Share on other sites

Have you tried simply naming the unit you want "rescue" to join and not use it's group id ?

Share this post


Link to post
Share on other sites

To remove an action you need to give it an ID first. addAction

_myaddaction1 = player addAction ["Hello", "hello.sqs"];

Then later it is much easer to remove. removeAction

player removeAction _myaddaction1;

Share this post


Link to post
Share on other sites
Sign in to follow this  

×