Scripts / script to "disguise" the player ?

Author
Message
reyandekcire
8
Years of Service
User Offline
Joined: 18th Feb 2016
Location:
Posted: 3rd May 2017 20:38
Hi dear community,

After weeks and weeks of tries, i'm still only able to make very basic script ( opening a crate or refuelling a generator to switch light on for example).
I've tried to make a script that would allow the player to be considered "friendly" by ennemy AI after he found an ennemy uniform (this being managed by a variable). For those who know the "Commandos" games serie, it is supposed to work like the "Spy" character., stealing a german uniform and wandering in the ennemy coumpound undetected.
I suppose I have to use the "require" and/or "include" script command (or maybe the "switchscript (e,str)" ) command to switch AI behaviour between Ai_Neutral and Ai_Soldier scripts according to the "uniform" variable value but I just can't find out how it works...
I'm OK with the script attached to the uniform (collect item, revert "has_uniform" variable value from 0 to 1, destroy the uniform etc..) but the disguise script is far beyond my skills at this time...

I suppose the script's structure would be :
check the "hasuniform" value
if "hasuniform" == 0 then run Ai_soldier script
if "hasuniform" ==1 then run Ai_Neutral script
if the player is seen killing an ennemy while in disguise, then "hasuniform" == 0

But all my attempts pathetically failled...

I would be immensively gratefull if some of you, talented scripters, could give me some help.

Cheers
PM
Zero_HP
7
Years of Service
User Offline
Joined: 31st Mar 2017
Location: Leicester
Posted: 4th May 2017 00:44
Take a look on the Smallg thread, I recently asked about a script that would make an npc hostile after picking up a certain item. Maybe you'd be able to do somethinglike he suggests but in reverse
reyandekcire
8
Years of Service
User Offline
Joined: 18th Feb 2016
Location:
Posted: 4th May 2017 20:18
Hi Zero_HP,

thanks for the tip. I will check Smallg's thread more carefully
PM
Zero_HP
7
Years of Service
User Offline
Joined: 31st Mar 2017
Location: Leicester
Posted: 4th May 2017 20:52
It's was only the other day i asked, so it'll be toward the end of the thread. Hope it helps
reyandekcire
8
Years of Service
User Offline
Joined: 18th Feb 2016
Location:
Posted: 4th May 2017 22:02
I've just tested what Smallg suggests and it works fine ....
many thanks to him and to you.

For anyone who might be interested, here is the script.

Attachments

Login to view attachments
PM

Login to post a reply

Server time is: 2024-12-23 05:06:18
Your offset time is: 2024-12-23 05:06:18