Product Chat / Beat me up, AI!

Author
Message
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 7th Sep 2015 08:15
Hi there. i have a special problem again. in my first map i would like to have the following situation: the player is alone on a beach and only has a knife. there are some bad guys i have to stab, they only have strength 50 wich makes them easy to be killed with 2 stabs.
for this scene i have chosen the "unarmed drunk" character from the medieval folder. this is a funny looking dude who looks like a sailor whos has had a little too much to drink. he stands and walks like he did so as well. when you attach the "fantasycharacter.lua" to this character he always starts beating me up when i get to him.
you really see how he punches me all the time till i die or i kill him. he is really doing this perfectly.

because in my game the bad guys are terrorists, pirates and so on and no medieval drunkies i built me a few bad guys with the character creator. i made a green soldier uniform and a random head WITHOUT(!) custom faces, three soldiers, NO weapon.

when i put this guy in my map with "fantasycharacter.lua" or "AI_Melee.lua" he is hurting me when i get to him but he does not punch me. the character does not have / do the animations that the drunkie does. all he does is aim at me with his non existing pistol and then my health is reduced and i see red.

what can i do to make the character creator- created soldier smack me up like the drunken sailor does?
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Sep 2015 13:03
firstly you need to copy and rename the script (AI_fantasycharacter.lua) and then change line 89 to SetAnimationFrames(2340,2382), now give the characters you created this script
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 7th Sep 2015 16:05 Edited at: 7th Sep 2015 16:19
yes, now it works! but when the guy punches me it does not hurt me! it should where can i change that? this my script right now:



thank you so far, this is already looking great. look at the picture lol
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Attachments

Login to view attachments
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Sep 2015 16:12
Quote: "function ih_melee.lua_main(e)"
&
Quote: "ih_melee.lua_init(e)"


dont need the .lua
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 7th Sep 2015 16:20
yes, i already saw this and i changed this, i edited the last post. now it works but i still have a little problem. the punches don't hurt me.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Sep 2015 18:27
ah ok you also need to change this part (lines 21 & 22) to allow it to hurt you
damageframestart[e]=170
damageframeend[e]=180
to something like
damageframestart[e]=2360
damageframeend[e]=2370
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 7th Sep 2015 21:14
YES! it's working! thank you very much! every hit costs about 5 lifepoints, that's good. can i change the damage of the punches the AI makes? THANK YOU

for all of you who want to use this script, an evil unarmed character (created with GG character creator) who beats you up, here it is!

ih_melee.lua


http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Sep 2015 22:54
seems the damage is based on their hp so the closer to death they get the less damage they do.. nice
(line 111) HurtPlayer(e,g_Entity[e]['health']/4)
anyway that's the line to change
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 8th Sep 2015 06:14
thanks. i totally didn't know what i was doing there. impressing that changing some numbers makes the character behave differnetly, but it works. i didn't think this could be solved with a script, and i also thought this is impossible. great, everything is working. now i can put them all in my resort. this can really become some first person stabber.
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Login to post a reply

Server time is: 2024-11-25 09:52:05
Your offset time is: 2024-11-25 09:52:05