I was talking to digdug on irc about an onHit event for devices (yes I know I brought this up before)
My basic thoughts on this would be armor and shields would have an onHit event that would be called whenever they where hit. It would need the attacker and defender items with functions to get the space object that fired it or has it equipped.
Things that could be done with this are
random devices: weapons/shields/armor that would change there basic stats from game to game.
dynamic devices: weapons/shields/armor that change over time through events or time
new damage system: Any damage system you could think of could be put in from super complex ones to even simpler ones
interesting defenders: Like armor that regenerates with certain damage types or a shield that throws out a damaging wave when hit
stacking of enhancements: you could have as many enhancements as you wanted
onHit event
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
Crying is not a proper retort!
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
You don't need an OnHit event to have devices that alter over time. I have a prototype organic technology system that uses the event manager to 'grow' into better stages.
Nor would an OnHit event help devices change their stats randomly. This can be done with enhancements, to the limit that shpEnhanceItem allows. More control over the item attributes would be fun, but more than a simple OnHit is needed for that.
You can already stack enhancements. But the enhancements are somewhat limited.
Considering the lag factor, how much real benefit is OnHit going to deliver if implemented massively?
OnHit events would be fun, but it won't make up for the enhancement limits, and it wouldn't be able to change item stats dynamically.
Nor would an OnHit event help devices change their stats randomly. This can be done with enhancements, to the limit that shpEnhanceItem allows. More control over the item attributes would be fun, but more than a simple OnHit is needed for that.
You can already stack enhancements. But the enhancements are somewhat limited.
Considering the lag factor, how much real benefit is OnHit going to deliver if implemented massively?
OnHit events would be fun, but it won't make up for the enhancement limits, and it wouldn't be able to change item stats dynamically.
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
well if you could change damage and damage type dynamically wouldn't that change there basic stats? Or cost?
With an onHit you can have any kind of enhancement you could think of without any limits. You could stack damage things and more damage, you could stack fast fire and more damage, you could do nearly anything you want (onFire would be needed for different kinds of fast fire.)
I don't think lag will be much of an issue we already have hitEffect and those are much slower.
With an onHit you can have any kind of enhancement you could think of without any limits. You could stack damage things and more damage, you could stack fast fire and more damage, you could do nearly anything you want (onFire would be needed for different kinds of fast fire.)
I don't think lag will be much of an issue we already have hitEffect and those are much slower.
Crying is not a proper retort!
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
How would OnHit change factors?
I am just saying you need more than a simple OnHit event function, Betel.
Detecting weapon fire is one step, but you need more functions to make the adjustments. Or post some sample code of your ideal OnHit functions to explain the process better, please. I just don't see how you get from OnHit to random stats changes over time and dynamic evolution of items and damage enhancement stacking.
I am just saying you need more than a simple OnHit event function, Betel.
Detecting weapon fire is one step, but you need more functions to make the adjustments. Or post some sample code of your ideal OnHit functions to explain the process better, please. I just don't see how you get from OnHit to random stats changes over time and dynamic evolution of items and damage enhancement stacking.
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
well I am assuming items will have data (or at least some way to fake that)
where gattacker is the spaceObject bullet and gdefender is the armor or shield (there are some helper functions here but it is just the basic idea
this is a simplistic example but still it shows the idea
where gattacker is the spaceObject bullet and gdefender is the armor or shield (there are some helper functions here but it is just the basic idea
Code: Select all
<onhit>
(block (resistance damageType damage)
(setq damage (itmGetGlobaldata (objGetOrigin gattacker) "damage"))
(setq damageType (itmGetGlobaldata (objGetOrigin gattacker) "damageType"))
(setq resistance (item (itmGetGlobaldata gdefender "damageType") damageType))
(setq damage (divide (multiply damage resistance) 100))
(intdamageDefender damage)
)
</onhit>
Crying is not a proper retort!
your timer allows items to grow over time/
OnHit would allow items to grow based on how much they are used successfully and could be used to make the anti-borg gun that was suggested a little while ago but couldn't be created nicely because you had to take the shields all the way down in order to change damage types (certainly wouldn't work against the luminous).
OnHit would allow items to grow based on how much they are used successfully and could be used to make the anti-borg gun that was suggested a little while ago but couldn't be created nicely because you had to take the shields all the way down in order to change damage types (certainly wouldn't work against the luminous).
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
couple more thoughts
allows emulation of wmd weapons and things like that
such as weapons that effect shields much different than armor
weapons that take do more damage to metal armors
allows emulation of wmd weapons and things like that
such as weapons that effect shields much different than armor
weapons that take do more damage to metal armors
Crying is not a proper retort!
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
only one needs to be done either weapons or armor/shields and you would have the benefits of both, but having both would allow better code (as long as a convention is followed such as the armor/shields handle damage plus any armor/shield extra effects and all that weapons onhit do is extra weapon effects
Crying is not a proper retort!