Update your game for 94.+ - UnitPreDamaged Callin Change

Update your game for 94.+ - UnitPreDamaged Callin Change

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Update your game for 94.+ - UnitPreDamaged Callin Change

Post by Forboding Angel »

https://code.google.com/p/zero-k/source ... lyfire.lua

I'm using this gadget, in conjunction with this widget:
https://code.google.com/p/evolutionrts/ ... mander.lua

And is has been working fine until spring 93+. At which point, it started erroring out like crazy. This was due to an old version I was using, so I updated it to the latest in ZK.

Now all of a sudden the emp is paralyzing my own units too QQ.

What am I doing wrong?
[22:12:41] <[Evo]Forboding_Angel> hey car
[22:12:48] <[Evo]Forboding_Angel> could you help me with this?
[22:12:57] <CarRepairer> depends
[22:12:57] <[Evo]Forboding_Angel> http://springrts.com/phpbb/viewtopic.php?f=14&t=29985
[22:13:11] <[Evo]Forboding_Angel> I don't understand why it's not working
[22:13:25] <[Evo]Forboding_Angel> the gadget just checks to see if the customparam is set
[22:13:40] <[Evo]Forboding_Angel> at which point it shoudl work, shouldn't it?
[22:14:49] <[Evo]Forboding_Angel> As you know the emp is all aoe
[22:14:59] <[Evo]Forboding_Angel> does that make a difference now?
[22:28:09] <CarRepairer> did you modify the gadget?
[22:28:34] <CarRepairer> oh i know
[22:28:41] <CarRepairer> the unitpredamaged has changed in spring 94
[22:28:44] <CarRepairer> go yell at #sy
[22:33:37] <[Evo]Forboding_Angel> ohy?
[22:33:41] * [Evo]Forboding_Angel Slaps CarRepairer around with a large PeeWee!
[22:33:49] <[Evo]Forboding_Angel> Sorry had to run to the -------
[22:33:50] ** SATO_S left the channel( Quit ).
[22:34:39] <[Evo]Forboding_Angel> looks like an arg was added to it
[22:37:20] <[Evo]Forboding_Angel> interesting
[22:37:26] <[Evo]Forboding_Angel> the changelog lists weapondefID
[22:37:35] <[Evo]Forboding_Angel> but the gadget is using weaponID?
[22:37:36] <[Evo]Forboding_Angel> O_o
[22:38:30] <[Evo]Forboding_Angel> That fixed it..
[22:38:33] <[Evo]Forboding_Angel> thanks car :-)
[22:38:46] <[Evo]Forboding_Angel> I jsut added projectileID to the arg list :-)
For anyone else who doesn't understand... simply make this change:

Code: Select all

function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, 
                            weaponID, attackerID, attackerDefID, attackerTeam)
to

Code: Select all

function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, 
                            weaponID, projectileID, attackerID, attackerDefID, attackerTeam)
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Need some help with friendly fire [Fixed]

Post by Forboding Angel »

Btw, if you're having issues with noselfpwn, make this same change in there and it will work (theoretically).
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Update your game for 94.+ - UnitPreDamaged Callin Change

Post by FLOZi »

Changed topic title and stickied, had asked devs to make an announcement wrt this change.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Update your game for 94.+ - UnitPreDamaged Callin Change

Post by Silentwings »

You need to add another argument. It used to be
function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, attackerID, attackerDefID, attackerTeam)
and it is now
function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam)
E.g. http://imolarpg.dyndns.org/trac/balatest/changeset/1009

Edit: Opps, didn't read far enough down forbs text-wall to realize he had solved it xD
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Update your game for 94.+ - UnitPreDamaged Callin Change

Post by Anarchid »

ZK fixed this by hacking at their gadgets.lua.

Introduces confusion? Yes, sure. But also makes the change backwards-compatible.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Update your game for 94.+ - UnitPreDamaged Callin Change

Post by Forboding Angel »

Anarchid wrote:ZK fixed this by hacking at their gadgets.lua.

Introduces confusion? Yes, sure. But also makes the change backwards-compatible.
Thanks. This solved a lot of problems for me.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Update your game for 94.+ - UnitPreDamaged Callin Change

Post by Silentwings »

Really?! That seems like overkill when you can grep search and replace (or use notepad++ on win).
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Update your game for 94.+ - UnitPreDamaged Callin Change

Post by Forboding Angel »

The steps I outlined in the OP didn't actually work as I had thought. It just made units with the friendlyfire tag not do any damage at all.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Update your game for 94.+ - UnitPreDamaged Callin Change

Post by abma »

next time please don't such a thread sticky. use it to publish about an update for the wiki to get feeedback.

next time directly update http://springrts.com/wiki/EngineChangelogForContentDevs

sticky threads like this one should be avoided, as they always have to be unstickied which is a lot of work and leads to confusion as they are outdated very quickly.


thanks!
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Update your game for 94.+ - UnitPreDamaged Callin Change

Post by FLOZi »

Forum threads provide visibility which wiki just does not have; not to mention that vital ingredient - discussion. Perhaps not in this thread but so useful in others not dissimilar to it.

Worth remembering that until fairly recently forum moderation was virtually extinct so things may have got more cluttered than is desirable.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Update your game for 94.+ - UnitPreDamaged Callin Change

Post by knorke »

FLOZi wrote:Forum threads provide visibility which wiki just does not have; not to mention that vital ingredient - discussion.
Yes, hence the trick is to use forum "like normal" and on the wiki one just have links to important threads or postings.
When a thread is new, it gets enought visibility - just from being on top.
To give more "long time visibility" to thread it gets added to http://springrts.com/wiki/EngineChangelogForContentDevs

When one wants other to know that something was added to that page, can just bump this thread: http://springrts.com/phpbb/viewtopic.php?t&t=27777

But that should usually not be nessecary, since most people will either
a) have seen the thread when it was active (active threads=on top automatically)
or
b) will come along the thread when they read http://springrts.com/wiki/EngineChangelogForContentDevs to see what changed.
Post Reply

Return to “Game Development”