Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / "Head shot" image script

Author
Message
Soviet176
15
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 17th Nov 2010 03:23 Edited at: 17th Nov 2010 03:25
Hello again scripting community. I present you with, yet again, another problem I am having. This time I tried though.

I am making a script that if you shoot someone in the head, it will display an image, and make a sound, this script will be put into the appear slot, and will hopefully work in multi-player games.

So far I have this:



Head shots actually work (Tested single player only) but I hope that it may just work with multi-player. Really it will display the image on the screen that killed the guy via head shot. Any help would be appreciated. Thank you!

Putting fear back into sliced bread since 4th May 2010
Wolf
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 17th Nov 2010 04:16
I don't think that you can implement characterscripts to multiplayer...



-Wolf

God Helps the Beast in Me!
Scene Commander
Support Manager
16
Years of Service
User Offline
Joined: 3rd May 2008
Location:
Posted: 17th Nov 2010 11:26
Also, multiplayer doesn't support AI

http://jimjamsgames.yolasite.com
Soviet176
15
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 17th Nov 2010 20:56 Edited at: 17th Nov 2010 21:02
Hmm, alright, well is it possible to do in single player? I mean, I can't find out why my code does not work :/ i thinks its because of the states

Putting fear back into sliced bread since 4th May 2010
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 17th Nov 2010 21:10
In multiplayer,no.

What you are writing seems wrong to me though,because if I'm not mistaking you are putting this as a characters appear script,which is only ran once and it needs to be looped in order to check anything.

There's also no indicator whether the character was shot in the head or not.

Theres a shotdamage=x condition,which you can use,and usually x is the amount of damage the entity has taken and above.Meaning if you set headshotdamage=80 or more for example, in the entity's appear script and then add a condition such as

:state=n,shotdamage=80:timerstart,hudshow=x,sound=x,state=n+1
:state=n+1,timergreater=5000:hudunshow=x,state=n+2


then it would sort of trick the engine into thinking what you want.
I'm not sure how this will turn out , but in theory it seems like a good idea.

Soviet176
15
Years of Service
User Offline
Joined: 19th Sep 2009
Location: Volgograd
Posted: 17th Nov 2010 21:50
@Gencheff

Greetings comrade! at first, I didnt think the code worked either. But believe it or note the code

:state=0:state=1,setalphafade=100,headshot=60,animate=1
:state=1,alphafadeequal=0:incalphafade=100
:state=1,alphafadeequal=100:state=2,addaiteam=2,aiaddenemy=1 2,runfpidefault=1


works for head shots, I am just trying to add an image when the character you killed dies, and display an image. Here is the thread I got the working head shot from.

http://forum.thegamecreators.com/?m=forum_view&t=175451&b=23

Putting fear back into sliced bread since 4th May 2010
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 17th Nov 2010 21:57 Edited at: 17th Nov 2010 21:57
Well comrade it's quite simple.you need 2 things in the appear script to make headshots work.

1. Add height where the head of the character is : headshot=60 (usually on humans its 60)
2. Specify the amount of damage which will be dealth when the character is shot in the head : headshotdamage=100 (or whatever value)

So basically your appear script should be like this.




and this is assuming your character will die from 1 headshot and it's health is 100.

Now all you need to do is add as simple line to the character's MAIN script where it will check if the amount of damage dealth on a shot is equal to the amount of damage usually dealth when shot in head , in other words 100.

So the line should be :

:shotdamage=100:hudshow=yourhud,sound=path to your headshot sound

This won't need any state changes,because it won't loop.After shooting the character in the head , his destroy script will be activated and thus the hud will disappear and so on.

Hope this helps.

Login to post a reply

Server time is: 2024-11-24 16:49:57
Your offset time is: 2024-11-24 16:49:57