Page 1 of 1

Update your game for 94.+ - UnitPreDamaged Callin Change

Posted: 26 Mar 2013, 04:34
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)

Re: Need some help with friendly fire [Fixed]

Posted: 26 Mar 2013, 06:41
by Forboding Angel
Btw, if you're having issues with noselfpwn, make this same change in there and it will work (theoretically).

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

Posted: 26 Mar 2013, 08:43
by FLOZi
Changed topic title and stickied, had asked devs to make an announcement wrt this change.

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

Posted: 26 Mar 2013, 11:52
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

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

Posted: 26 Mar 2013, 12:03
by Anarchid
ZK fixed this by hacking at their gadgets.lua.

Introduces confusion? Yes, sure. But also makes the change backwards-compatible.

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

Posted: 27 Mar 2013, 02:00
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.

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

Posted: 27 Mar 2013, 03:06
by Silentwings
Really?! That seems like overkill when you can grep search and replace (or use notepad++ on win).

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

Posted: 27 Mar 2013, 03:59
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.

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

Posted: 24 Jul 2013, 01:48
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!

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

Posted: 24 Jul 2013, 02:31
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.

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

Posted: 24 Jul 2013, 20:59
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.