Question about CSmActionEvent

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
10000370
Posts: 15
Joined: 11 Aug 2014, 09:37

Question about CSmActionEvent

Post by 10000370 »

can somebody please explain when OnHitPlayer, OnProjectileStart, OnProjectileEnd, and OnActiveChange are called.

What has to happend in order to get these events to activate?
GabrielM
Posts: 243
Joined: 13 Jan 2012, 16:53

Re: Question about CSmActionEvent

Post by GabrielM »

Those events are to be used in the context of an action, made in the action maker.

I would say that :
- OnHitPlayer is called when a projectile of the action hits a player
- OnProjectileStart is called when a projectile just appeared (e.g when you just pressed fire)
- OnProjectileEnd is when the projectile dies but i'm not sure if it's only when the projectile dies from timeout, or when it dies in any case, including hitting a player or a wall)
- OnActiveChange i'm really not sure about this one, it could be when you select this action in-game. (e.g if your action is bind on Activable3, you're not using this action, and you press 3 to start using it)

If someone has used actions recently and has a better explanation / correction, please feel free to help :).
User avatar
Gugli
Nadeo
Nadeo
Posts: 536
Joined: 14 Jun 2010, 17:35
Location: Mon PC est à Paris, mais mon coeur rode dans les forêts de Lozère

Re: Question about CSmActionEvent

Post by Gugli »

OnProjectileEnd is when the projectile dies in any case (including hitting a player or a wall). There's one OnProjectileEnd for each OnProjectileStart (symmetry \o/).

Concerning OnActiveChange :
First, a little reminder. IsActive is a Boolean that show the input associated to the action. Ex : if the action is bound to the input "Weapon" (usually left button on the mouse), IsActive will be true whenever the player press left button, and False if the button is released.
This can be used for regular weapons, but also to make Hold-To-Charge weapons or such likes. In some other cases, it's more useful to be notified when IsActive changes. That's what the event OnActiveChange is doing. This event is fired whenever IsActive has just changed.

Hope it helps.
--
(>~_~)> ═╦═ ╔╦╗ <(~_~<)
novationx
Posts: 2723
Joined: 10 Aug 2013, 22:33

Re: Question about CSmActionEvent

Post by novationx »

WOW.
So its possible to make semtex grenades & cook them?
The neverending waiting game has to stop.
User avatar
Gugli
Nadeo
Nadeo
Posts: 536
Joined: 14 Jun 2010, 17:35
Location: Mon PC est à Paris, mais mon coeur rode dans les forêts de Lozère

Re: Question about CSmActionEvent

Post by Gugli »

novationx wrote:WOW.
So its possible to make semtex grenades & cook them?
You mean in your garage ??? That would be dangerous !!!

Just kidding xD. And indeed, the Action Maker, and the corresponding script API, are not designed only to make new weapons, but also consumables (potions...), auras, or as you said : "the action of planting a bomb in a specific spot". That's why it's called an "Action" : it's intended to be anything a Shootman can do :)

And I'm pretty confident that with time, people will start to make plenty of other awesome stuff with it. ^_^
--
(>~_~)> ═╦═ ╔╦╗ <(~_~<)
novationx
Posts: 2723
Joined: 10 Aug 2013, 22:33

Re: Question about CSmActionEvent

Post by novationx »

Gugli wrote:
novationx wrote:WOW.
So its possible to make semtex grenades & cook them?
You mean in your garage ??? That would be dangerous !!!

Just kidding xD. And indeed, the Action Maker, and the corresponding script API, are not designed only to make new weapons, but also consumables (potions...), auras, or as you said : "the action of planting a bomb in a specific spot". That's why it's called an "Action" : it's intended to be anything a Shootman can do :)

And I'm pretty confident that with time, people will start to make plenty of other awesome stuff with it. ^_^

Okay, as you know ( or not ) Ive made weapons before in the action-maker & I think I know most of the options...
but I think that you really need to script in order to make my semtex work, am I right?

( I dont like to write code :( )
The neverending waiting game has to stop.
User avatar
Gugli
Nadeo
Nadeo
Posts: 536
Joined: 14 Jun 2010, 17:35
Location: Mon PC est à Paris, mais mon coeur rode dans les forêts de Lozère

Re: Question about CSmActionEvent

Post by Gugli »

novationx wrote: Okay, as you know ( or not ) Ive made weapons before in the action-maker & I think I know most of the options...
but I think that you really need to script in order to make my semtex work, am I right?

( I dont like to write code :( )

Yep, I know some of the great stuff you've created ^_^. :thx:

Unfortunately for you, making more complex and varied actions will indeed require some scripting. Maybe you can find someone motivated to help you with the scripting part. As always, I and other devs will do our best to answer your questions too.
--
(>~_~)> ═╦═ ╔╦╗ <(~_~<)
novationx
Posts: 2723
Joined: 10 Aug 2013, 22:33

Re: Question about CSmActionEvent

Post by novationx »

Gugli wrote:
novationx wrote: Okay, as you know ( or not ) Ive made weapons before in the action-maker & I think I know most of the options...
but I think that you really need to script in order to make my semtex work, am I right?

( I dont like to write code :( )

Yep, I know some of the great stuff you've created ^_^. :thx:

Unfortunately for you, making more complex and varied actions will indeed require some scripting. Maybe you can find someone motivated to help you with the scripting part. As always, I and other devs will do our best to answer your questions too.
Super cool ;)
What about some documentation , maybe? Can it be found somewhere? I already looked around a bit, but I can only find the kamehameha-tutorial.

I also would like to suggest that NADEO should maybe( if they have the time) try to include examples of the new capabilities. The action-maker is out 4-5? months and I only know now that making chargable weapons is possible. It seems such a waste of time :(

suggestion: http://forum.maniaplanet.com/viewtopic.php?f=10&t=28603
( Please give us some examples of weapons, actions, poses to work with , as examples & to learn )

Just imagine if you'd post a supersexy stormwoman on your FB-page in a seducing pose :D
"Try out our new pose-maker."
Everybody would be motivated instantly to create something themselves & they know how because of "examples" & "documentation"
Please :)
Last edited by novationx on 28 Aug 2014, 17:59, edited 2 times in total.
The neverending waiting game has to stop.
10000370
Posts: 15
Joined: 11 Aug 2014, 09:37

Re: Question about CSmActionEvent

Post by 10000370 »

Gugli wrote:OnProjectileEnd is when the projectile dies in any case (including hitting a player or a wall). There's one OnProjectileEnd for each OnProjectileStart (symmetry \o/).

Concerning OnActiveChange :
First, a little reminder. IsActive is a Boolean that show the input associated to the action. Ex : if the action is bound to the input "Weapon" (usually left button on the mouse), IsActive will be true whenever the player press left button, and False if the button is released.
This can be used for regular weapons, but also to make Hold-To-Charge weapons or such likes. In some other cases, it's more useful to be notified when IsActive changes. That's what the event OnActiveChange is doing. This event is fired whenever IsActive has just changed.

Hope it helps.
I made a simple projectile action and added code to show if any of the events trigger by using the Log(). the OnPlayerHit and OnActiveChange works. However, I cant seem to make the OnProjectileStart or the OnProjectileEnd to Trigger.
10000370
Posts: 15
Joined: 11 Aug 2014, 09:37

Re: Question about CSmActionEvent

Post by 10000370 »

novationx wrote: What about some documentation , maybe? Can it be found somewhere? I already looked around a bit, but I can only find the kamehameha-tutorial.

I also would like to suggest that NADEO should maybe( if they have the time) try to include examples of the new capabilities. The action-maker is out 4-5? months and I only know now that making chargable weapons is possible. It seems such a waste of time :(

suggestion: http://forum.maniaplanet.com/viewtopic.php?f=10&t=28603
( Please give us some examples of weapons, actions, poses to work with , as examples & to learn )

Just imagine if you'd post a supersexy stormwoman on your FB-page in a seducing pose :D
"Try out our new pose-maker."
Everybody would be motivated instantly to create something themselves.
I agree with Novationx, That would be very helpful in getting people to create more content for everyone to enjoy
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest