by Kzer-Za » Thu Feb 14, 2019 8:17 am
I went on with organizing the structure and run into a problem: several classes in my zscripts define variables. While they were in the main folder it didn't cause problems, but now that they are in a subfolder and included into the main file, the game won't load with this error:
Code: Select all
:zscript/monster_projectiles/zscript.hl_8_proj_lich, line 181: Attempt to redefine 'hitList'
:zscript/monster_projectiles/zscript.hl_5_proj_beast, line 3: Original definition is here
:zscript/monster_projectiles/zscript.hl_8_proj_lich, line 257: Attempt to redefine 'hitList'
:zscript/monster_projectiles/zscript.hl_5_proj_beast, line 56: Original definition is here
The definition is this:
Code: Select all
Class BrutalWereDragonBall : FastProjectile replaces BeastBall
{
Array<Actor> hitList;
override int SpecialMissileHit (Actor victim)
{
if (victim.GetSpecies() == target.GetSpecies())
return 1;
if (hitList.Find (victim) == hitList.Size())
{
victim.DamageMobj (self, target, 10, 'Fire');
hitlist.Push (victim);
}
A_PlaySound("world/lavasizzle", CHAN_AUTO);
return 1;
}
Default
...
For other classes the definition is the same. What should I do about it? Just renaming the variable seems strange since it does the same thing, so giving it different names in different classes would make it more difficult to keep track of things
I went on with organizing the structure and run into a problem: several classes in my zscripts define variables. While they were in the main folder it didn't cause problems, but now that they are in a subfolder and included into the main file, the game won't load with this error:
[code]
:zscript/monster_projectiles/zscript.hl_8_proj_lich, line 181: Attempt to redefine 'hitList'
:zscript/monster_projectiles/zscript.hl_5_proj_beast, line 3: Original definition is here
:zscript/monster_projectiles/zscript.hl_8_proj_lich, line 257: Attempt to redefine 'hitList'
:zscript/monster_projectiles/zscript.hl_5_proj_beast, line 56: Original definition is here
[/code]
The definition is this:
[code]
Class BrutalWereDragonBall : FastProjectile replaces BeastBall
{
Array<Actor> hitList;
override int SpecialMissileHit (Actor victim)
{
if (victim.GetSpecies() == target.GetSpecies())
return 1;
if (hitList.Find (victim) == hitList.Size())
{
victim.DamageMobj (self, target, 10, 'Fire');
hitlist.Push (victim);
}
A_PlaySound("world/lavasizzle", CHAN_AUTO);
return 1;
}
Default
...
[/code]
For other classes the definition is the same. What should I do about it? Just renaming the variable seems strange since it does the same thing, so giving it different names in different classes would make it more difficult to keep track of things