More event hooks and action hooks

blah900
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat May 31, 2014 12:42 am
Contact:

More event hooks and action hooks

Post by blah900 »

I only started modding recently so I am not sure whether a few of these are possible at the moment or not but as far as I know, it isn't possible. Please pardon me if it has been asked before, I carried out a few searches and I saw a few posts but they were more about the logistic side whereas I wanted to focus more on combat portion of the game.

Events:
ondamage, onkill, ondamaged, and onuseditem.
It would be nice to be able to do something like lifesteal or trigger something when damaged when under a certain amount of hp. Or even just reflecting back damage for new alien types.
Also might be interesting if you can figure out when an item is used and provide short bursts of speed/faster regen.

It would also be nice if you are able to spawn effects such as spawn bullet effects (not sure if this is possible with createentity but I haven't been able to get this working.)
A possible usage for this is like fragmentation grenade or something of the sort where you can throw a grenade that explodes and shoot bullet in multiple directions.

With conjunction of the two I am guessing it is possible to do something like you shoot a bullet and it hits a target, use onentitydied(to get the bullet position) or ondamged(get entity damaged, damage source) to make it split off into more bullets. I get an inkling that "nested-result" might have something to do with this but I am just not sure how it works exactly to make something like this work.

Some kind of queuing system would be also great. While this can be done by using ontick event in conjunction with a table to keep track of when things should be executed given a wait time, I get the feeling having the c++ handle this section would be much more effective.

Edit: Less urgent would be to be able to chain actions together in both serial and parallel manner. For example the shotgun is parallel action of creating n spawn effects. It would be nice if these actions could also be chained together with wait_ticks in between. This could create a more interesting effect of dual wielding weapons (instead of just cutting down cooldown in half) and also possibly allow some combo moves, depending on whether you can move, use other items, or you are forced to wait until the actions finish.
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: More event hooks and action hooks

Post by cube »

Before 0.10.0 there are attack results for weapons and capsules which do something like you described. In 0.10.0 and later, they have been renamed to triggers, appear on a few more places (train drives over tie, vehicle crash, ...) and are planned to spread to many entity related effects.
I have no idea what I'm talking about.
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: More event hooks and action hooks

Post by drs9999 »

Huh, did I miss anything?! Afaik the triggers are not accessible at runtime (before and in 0.10).
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: More event hooks and action hooks

Post by cube »

Not at runtime now, but you can use them to make something like the grenade that shoots fragments and lots of other fun weapons ;-)
I have no idea what I'm talking about.
Post Reply

Return to “Implemented mod requests”