Product Chat / Headshot damage - how to change it

Author
Message
JohnS_CZ
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location: Czech republic
Posted: 28th Apr 2016 19:44
Hi,
I'm trying to setup lower headshot damage. Currently, 1 headshot is enough to kill an enemy with pistol. But I would like it to be about 3-4 shots for a "boss-like" enemy.
How can I do that? I've tried script from here https://forum.game-guru.com/thread/214056 but nothing has changed.
Thanks
PM
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 28th Apr 2016 21:46
Forget the script Pirat Myke just shows how you disabled the headshot.

What you want is a counter.

So it should look like this:

Of course you must implement the array

If you do not know how to do this, look here where I did it for the standart ai_soldier.lua:


I did not test it, so I hope it works for you.
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
JohnS_CZ
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location: Czech republic
Posted: 11th Jun 2016 10:03
Thank you so much for your reply, I haven't had enough time to try it and/or reply.
Your script does work, it takes more shots to kill enemy, but for some reason, AI is broken. Soldier is just standing there. Here is my script:


Do you know what could be the reason?
PM
JohnS_CZ
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location: Czech republic
Posted: 11th Jun 2016 16:22
Even when I copied your script, it does the same thing. Soldier is just standing there.
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Jun 2016 19:10
Not looked at the script, but here is what I would do.

This is just the head shot part of the script, so you need to insert it in the same place as in the default one. You will need to create headshot in the init at the start as well with headshot={}
That should work, not tried it just edited in notepad and put up, but can't see why it shouldn't work. If you want more or less than 3 shots then just change the count check number.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
JohnS_CZ
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location: Czech republic
Posted: 11th Jun 2016 20:52
Still doesn't work, sadly.
I've uploaded picture with the soldier just standing. I really don't know whats wrong.
I can kill it with those 3 shots, but thats all :/

Attachments

Login to view attachments
PM
JohnS_CZ
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location: Czech republic
Posted: 11th Jun 2016 21:19
OK, I give up.
I've edited normal ai_soldier.lua (was using cover until now), and AI works now...but it takes only 1 shot to head to kill soldier, again.
This is the code.
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 11th Jun 2016 23:27 Edited at: 11th Jun 2016 23:30
I have to ask .....
Head shots were requested for a very long time as many users felt a direct shot to the head should kill instantly ...
Why would you want to disable it ?
You probably have a very good reason ...I'm just curious

EDIT .... I just realised what you said in your first post ....Bosses etc ...
Ye I'm assuming everyones Human ..... of course I understand now
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 12th Jun 2016 00:30 Edited at: 12th Jun 2016 00:34
Since limbhit was introduced and the command - if string.find(string.lower(g_Entity[e]['limbhit']), "head") ~= nil then- it has been moved from hardcoded.
Search for the following in AI scripts and simply remark out the SetEntityHealth(e,0) line. It will then take three shots to take out the average soldier using a pistol including the headshots. You can simply adjust entity strength if you want to take more hits depending on the weapon used. Or even add a line to the original headshot limb command to use a specific weapon for a headshot or reduce health by increments in script.

Look for


There are a few ways to achieve what you want for your Boss..you could even use a specific limb to destroy quickly.....Achilles heel ?
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 12th Jun 2016 00:32
Weird. I've tried the code I sent you and the enemies attack as normal, but the head shot still kills instantly. Headcount doesn't even seem to count up. I tried the other code by Corno_1 and that does the same. I've had some odd results altering it around, including instant corpses, but so far no luck, too late to do much more tonight. I'm sure it's only a small thing, but it is eluding me.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.

Attachments

Login to view attachments
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 12th Jun 2016 00:43 Edited at: 12th Jun 2016 01:15
Quote: "Weird. I've tried the code I sent you and the enemies attack as normal, but the head shot still kills instantly."

More than likely the limbhit code is still present in the script, otherwise it does sound weird. Since remarking SetEntityHealth(e,0) does remove the instant kill I would simply use this since three shots from pistol would work fine. I would maybe look at removing all other limbs from taking damage as an alternative or even adding health to compensate for loss if I wanted to have only a few headshots kill the Boss.

Again alternatively you could set the Boss health real high and remove large chunks of health with each headshot (limbhit).
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 12th Jun 2016 01:55
Not sure if you have reset the hit each time with ResetLimbHit(e). If not, one hit will trigger the count repeatedly as if multiple hits received.

And of course if it has to be three head shots make sure you give the soldier a lot of health, say 5000 or the hits will just drain the health anyway before the headshots have accumulated.



Cheers.
JohnS_CZ
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location: Czech republic
Posted: 12th Jun 2016 10:40
Thank you cybernescence, your script seems to work.
I have one last problem. I don't want to use ai_soldier.lua, but script w/ different name to use it for those tougher enemies.
But, when I try it, AI either don't work or it affects all enemies. I know I have to edit name of the script into it, but I don't know where exactly (I'm really, really new to this).
I've tried to use rpg soldier ai as an example where should I edit the script name, but It just gave me errors. Any suggestions?
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 12th Jun 2016 12:58
If you call the script for example ai_boss_soldier.lua then inside the script you change:

ai_soldier_init(e) to ai_boss_soldier_init(e)
ai_soldier_main(e) to ai_boss_soldier_main(e)
ai_soldier_exit(e) to ai_boss_soldier_exit(e)

Cheers.








JohnS_CZ
9
Years of Service
User Offline
Joined: 4th Mar 2015
Location: Czech republic
Posted: 12th Jun 2016 13:49
Thank you so much, it works now!
I'll just post the code here, if anyone would be interested in changing this too! Thank you again!
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 12th Jun 2016 15:44
Ah, never used the limb collision commands, didn't realise you had to manually reset them. That would explain it


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.

Login to post a reply

Server time is: 2024-06-26 08:23:05
Your offset time is: 2024-06-26 08:23:05