Scripts / AI passive mode

Author
Message
Elmachtige
9
Years of Service
User Offline
Joined: 10th Jul 2015
Location:
Posted: 12th Jul 2015 00:06
Hello,

i was wondering how i can set an AI to only attack me when i hit him first?

thank you.
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 12th Jul 2015 01:57 Edited at: 12th Jul 2015 02:10
Possibly via scripting but not through properties at the moment ..
You could ask on the script board ...
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 12th Jul 2015 03:14
Ask and you shall receive... Thread moved.
....

My first thoughts on this is to use SwitchScript(e,scr)

Start your AI on ai_neutral.lua or similar and when you attack do a switch to an aggressive script, eg: ai_melee or ai_soldier
AKA SisterMatic (Steam)
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 12th Jul 2015 09:18
I am not really a scripter, but i tought there was some command as aggro check.

part of the script:



Harry
Harry
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 12th Jul 2015 11:14
All the commands work with "playerDist", so you've omitted this here and pass directly to "combat mode", because the player being visible "g_Entity[e]['plrvisible'] == 1" is not the goal here, I thougt.

So yes, SwitchScript(e,scr) may help, or modify "soldier.lua" and make it start as "neutral" and when "AIGetEntityHeardSound(EntObjNo) == 1" , pass directly to "combat mode".

I had seen something like this in medieval video, but does not remember where. In that video player walk into the town and nobody attack him, until him becomes agressive, so all the town people also does. Perhaps the author comes here.

3com

Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Elmachtige
9
Years of Service
User Offline
Joined: 10th Jul 2015
Location:
Posted: 12th Jul 2015 12:18 Edited at: 12th Jul 2015 13:48
thank you for the replies, where do i put SwitchScript(e,scr) in?
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jul 2015 19:54
give this a try
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments
Elmachtige
9
Years of Service
User Offline
Joined: 10th Jul 2015
Location:
Posted: 13th Jul 2015 00:02
great stuff smallg, it works...only it doesnt follow waypoints :3
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 13th Jul 2015 07:09
@smallg - where's that script from buddy? That's not one I have.

I mean, I do now, but I think you get my meaning.
AKA SisterMatic (Steam)
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Jul 2015 13:20
Quote: "great stuff smallg, it works...only it doesnt follow waypoints"

you never asked for it to follow waypoints

Quote: "@smallg - where's that script from buddy? That's not one I have."

i made it for his request

new script with waypoint detection
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments
Elmachtige
9
Years of Service
User Offline
Joined: 10th Jul 2015
Location:
Posted: 13th Jul 2015 17:58 Edited at: 13th Jul 2015 18:05
smallg, you're right ..i didn't my bad..anyway thanks a bunch.

my question is answered so this topic can be closed.
Jerry Tremble
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 13th Jul 2015 22:45
This is awesome and quite timely! I was curious about this while playing with the civilian characters from the character creator. Thank you so much!
MAME Cab PC: i7 4770@3.4Ghz (passmark 9945), 12GB RAM, Win 8.1/64, GeForce GTX645 (passmark 1898); Shiny new laptop: i7 4800MQ@2.7Ghz (passmark 8586), 16GB RAM, Win 8.1/64, GeForce GTX870M (passmark 3598); Old laptop: i5@2.3Ghz, 8GB RAM, Win 7/64, Intel 3000 graphics
PM

Login to post a reply

Server time is: 2024-12-22 01:25:35
Your offset time is: 2024-12-22 01:25:35