[Tuto] To correctly handle custom weapon hit

Moderator: NADEO

User avatar
Dommy
Translator
Translator
Posts: 1866
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

[Tuto] To correctly handle custom weapon hit

Post by Dommy »

There is just few lines of code to paste in events loop. It handles automatically +1 effect and sends unknown weapon hit notice :3

Everything can be found here:
http://github.com/domino54/title-packs/ ... stomHit.md

Thanks to Mewin and TM-Jinzo :thumbsup:
Last edited by Dommy on 29 Jul 2014, 11:55, edited 1 time in total.
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
User avatar
djhubertus
Translator
Translator
Posts: 1097
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

Re: To correctly handle custom weapon hit

Post by djhubertus »

So, AddPlayerArmor() is a solution? Time to check :yes:
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib
User avatar
phil13hebert
Posts: 564
Joined: 29 Oct 2011, 14:11
Location: Québec

Re: To correctly handle custom weapon hit

Post by phil13hebert »

I can confirm that it works :yes:
Thank you for this ! I was needing this so much !
OS: Windows 7 64 bit
CPU: Intel Core i7 3770 @ 3.40Ghz
RAM: 8GB DDR3 798MHz
GPU: Nvidia GeForce GTX 660 1536MB
Motherboard: Intel 0KM92T
Sound: 7.1
Peripherals: Logitech G510, SteelSeries sensei raw, Corsair vengeance 1500
User avatar
NJin
Posts: 712
Joined: 26 May 2012, 20:16
Contact:

Re: To correctly handle custom weapon hit

Post by NJin »

phil13hebert wrote:I can confirm that it works :yes:
Thank you for this ! I was needing this so much !
No Problem ;)
n-jin.xyz || Instagram || Twitter || Twitch || Discord: njin

Image
User avatar
fleo
Posts: 304
Joined: 02 Sep 2011, 12:56

Re: To correctly handle custom weapon hit

Post by fleo »

Ahah I guess that'll work better with AddPlayerArmor() than armor -= damage :lol:

Thanks :thx:
Follow me on my maniaflash. Try the new elitealternative! Feedbacks on this post. :thumbsup:

♫ I need αεяø. I'm holding out for αεяø 'til the end of the night. ♫
User avatar
fleo
Posts: 304
Joined: 02 Sep 2011, 12:56

Re: To correctly handle custom weapon hit

Post by fleo »

Just few questions because I'm curious and not home so I can't try :P

What exactly the AddPlayerArmor function does?
-Does it display the +1 orange/yellow message?
-If two consecutives +1 occur, does it make a +2 and so on?
-Does it trigger a hit sound?
-Does it display "player1 hit player2" on the side?
-Does it round Points to integer and Damage to hundred? (for instance if a weapon makes 182 damages, does it remove 1, 2 or 1.82 armors?)
-Does the victim get this strange orange filter on the border of the screen that indicates he's been hit?
-And finally, what do you mean by "it sends unknown weapon hit notice"?

I'll give answers if you don't know as soon as I'm home.
Follow me on my maniaflash. Try the new elitealternative! Feedbacks on this post. :thumbsup:

♫ I need αεяø. I'm holding out for αεяø 'til the end of the night. ♫
User avatar
phil13hebert
Posts: 564
Joined: 29 Oct 2011, 14:11
Location: Québec

Re: To correctly handle custom weapon hit

Post by phil13hebert »

fleo wrote:What exactly the AddPlayerArmor function does?
It adds 1 or many armor to the player. If you put a negative number, it removes armor.
fleo wrote:-Does it display the +1 orange/yellow message?
Yes. Orange when you hit and yellow when you kill (or the inverse).
fleo wrote:-If two consecutives +1 occur, does it make a +2 and so on?
Yes :D
fleo wrote:-Does it trigger a hit sound?
Yes
fleo wrote:-Does it display "player1 hit player2" on the side?
Yes
fleo wrote:-Does it round Points to integer and Damage to hundred? (for instance if a weapon makes 182 damages, does it remove 1, 2 or 1.82 armors?)
I don't know. I didn't test.
fleo wrote:-Does the victim get this strange orange filter on the border of the screen that indicates he's been hit?
I dind't test either.
fleo wrote:-And finally, what do you mean by "it sends unknown weapon hit notice"?
He means that with the AddPlayerArmor, the notices (to the left of the screen and +1, +2, etc.) are working with custom weapons.
ShooterPoints is only working for normal weapons for the moment so this workaround is realy useful. :D
OS: Windows 7 64 bit
CPU: Intel Core i7 3770 @ 3.40Ghz
RAM: 8GB DDR3 798MHz
GPU: Nvidia GeForce GTX 660 1536MB
Motherboard: Intel 0KM92T
Sound: 7.1
Peripherals: Logitech G510, SteelSeries sensei raw, Corsair vengeance 1500
User avatar
fleo
Posts: 304
Joined: 02 Sep 2011, 12:56

Re: To correctly handle custom weapon hit

Post by fleo »

You're awesome! :thx:

Do you know a way to handle energy of the weapon? To create a fast reload for a hit or to pause the reload etc. Has it to be done in the weapon script?

Same question about timers. Can we modify for instance the energy cost during a game?
Follow me on my maniaflash. Try the new elitealternative! Feedbacks on this post. :thumbsup:

♫ I need αεяø. I'm holding out for αεяø 'til the end of the night. ♫
User avatar
Dommy
Translator
Translator
Posts: 1866
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: To correctly handle custom weapon hit

Post by Dommy »

We didn't found any way to customize amount of ammo, only one thing possible is change the reload and damage. If we found working solution I'll create a new topic with how-to. :)

About ammo removing with damage example 50: shooter gets no notice on first hit and (I'm not sure) when victim gets damage that removes armor through round amount (ex. 200) it shows +1. Also victim has natural armor regen (normal, no replenish), so he/she will heal 100 hp in 2.5 seconds.
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
User avatar
fleo
Posts: 304
Joined: 02 Sep 2011, 12:56

Re: To correctly handle custom weapon hit

Post by fleo »

I used your method in my script and it works fine! Links are in my signature if you want to test :D

As you said 182 damages makes a +1 and the 82 left are automatically recovered. However if a second shot of 50 damages occurs right after, the +1 becomes a +2.
Follow me on my maniaflash. Try the new elitealternative! Feedbacks on this post. :thumbsup:

♫ I need αεяø. I'm holding out for αεяø 'til the end of the night. ♫
Post Reply

Return to “ActionMaker and Item editor”

Who is online

Users browsing this forum: No registered users and 0 guests