Canon deal no damages

Moderator: NADEO

Post Reply
User avatar
Guerro323
Posts: 610
Joined: 14 Jun 2014, 15:51

Canon deal no damages

Post by Guerro323 »

Hello, I was trying to create a beautiful canon item, but it's not deal any damages ( Tested with melee scripts and bot. )
So, how can I add damages to the canon ? :yes:
C'est Grandiose!
Image
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: Canon deal no damages

Post by Eole »

Actions don't deal damage by default, you have to manage that yourself in the game mode script. You can read this to learn how to do it.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
Guerro323
Posts: 610
Joined: 14 Jun 2014, 15:51

Re: Canon deal no damages

Post by Guerro323 »

Eole wrote:Actions don't deal damage by default, you have to manage that yourself in the game mode script. You can read this to learn how to do it.
I tried with your link, but when I put it on the script, it's work only for me when I shoot a custom weapon, but it's dont write the text when the cannon fire with the custom weapon :/
C'est Grandiose!
Image
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: Canon deal no damages

Post by Eole »

I'm not sure to understand what you are trying to do. You have a custom weapon, it deals damage when you fire the weapon yourself but not when the cannon fire it. What is this cannon exactly?
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
Guerro323
Posts: 610
Joined: 14 Jun 2014, 15:51

Re: Canon deal no damages

Post by Guerro323 »

Eole wrote:I'm not sure to understand what you are trying to do. You have a custom weapon, it deals damage when you fire the weapon yourself but not when the cannon fire it. What is this cannon exactly?
The Cannon item.
Image
C'est Grandiose!
Image
User avatar
Teardrop
Posts: 95
Joined: 02 Dec 2011, 19:47

Re: Canon deal no damages

Post by Teardrop »

Hi,

By default, the first parameter of an OnActionCustomEvent, created by a cannon is "cannon" , not "damage".


So you have to use this :

Code: Select all

if(Event.Param1 == "cannon"){			
if(Event.Victim != Null){
AddPlayerArmor(Event.Victim, -100, Null, 1);
}
}
PassOn(Event);
You can also modify the action script (by checking the "Custom action" button), if you want it to comport itself like a normal action.
User avatar
Guerro323
Posts: 610
Joined: 14 Jun 2014, 15:51

Re: Canon deal no damages

Post by Guerro323 »

Teardrop wrote:Hi,

By default, the first parameter of an OnActionCustomEvent, created by a cannon is "cannon" , not "damage".


So you have to use this :

Code: Select all

if(Event.Param1 == "cannon"){			
if(Event.Victim != Null){
AddPlayerArmor(Event.Victim, -100, Null, 1);
}
}
PassOn(Event);
You can also modify the action script (by checking the "Custom action" button), if you want it to comport itself like a normal action.
Oh thanks, it's work :yes:
C'est Grandiose!
Image
Post Reply

Return to “ActionMaker and Item editor”

Who is online

Users browsing this forum: No registered users and 1 guest