Forum Jump :

Author Message


Posts: 6
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-03-15 02:41        
     
I am in the middle of creating a deathmatch map of sorts. The east are insurgents imbedded in the civilian population on the map, and the west are US Army units trying to track down the insurgents. My dilemma is this.

I want to create AI that follow waypoints (no big deal). When a BluFor player walks within a certain distance from the AI, the AI explodes (suicide vest style). Any ideas on how to get this accomplished? I can do it with static AI and objects, but not while they are moving.

Thanks.


Author Message


Posts: 200
Rank:


Level: Member

Country: en
Location: Bucks, UK
Occupation: Commercial Logistics Facilitator
Age: 52
In-game name: tankbusterspaff

 
#2 Posted at 2013-03-15 07:41        
     
Personally, I wouldn't use a trigger for this. I'd use a waitUntil that waits until the distance between the AI and a player is within your certain distance.

http://community.bistudio.com/wiki/waitUntil
Note the waituntil can include a sleep which might be nice in these circumstances, not only does it cut down on CPU usage, but you can randomise the sleep a little for realism. Perhaps the insurgent might set off his bomb immediately the player comes near, maybe he might wait a second or two, for what ever reason - cold feet, perhaps?

http://community.bistudio.com/wiki/distance

It seems you are doing multiplayer. You need to keep locality in mind. You won't be able to use the 3rd example on the distance page as player doesn't exist on a dedicated server. You'll have to use some other method to get nearby players.


Advertisement


Author Message


Posts: 6
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2013-03-15 20:57        
     
Ok, so I'm still new to the scripting part of the editor. I wrote a .sqs for the civilian to execute via the init "null= this execVM "PBIED.sqs";"

PBIED.sqs reads
"_meters=[S1, S2, S3, S4, S5, S6, S7,S8] 20 [PBIED];
_bomb="SH_105_HE" createVehicle (getPos PBIED);"

-S1-S8 are the names of the soldiers, PBIED is the name of the civilian.

I realize I'm probably missing several things... as I said before I don't know much about the scripts. I basically just copy and paste what I need most of the time.

So does anyone have any advice? Anyone care to piece it together for me?

Added 21 hours 53 minutes later:

C'mon guys, any help would be appreciated. I'm struggling to put this together.

This post was edited by Stychiz (2013-03-16 19:02, ago)