2025-07-18 23:10 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002769Spring engineUnit Scriptingpublic2012-01-10 00:10
ReporterKingRaptor 
Assigned Toabma 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionno change required 
Product Version84.0 
Target VersionFixed in Version 
Summary0002769: Units created by gadget before gamestart do not function
DescriptionThe (LUS-scripted) PlanetWars buildings in ZK created before gamestart (during gadget:Initialize() ) behave as if they did not have scripts (no animation, unit not removed on death, etc.) /luarules reload fixes the problem.

Giving the same units with /cheat /give results in normal behavior.

Didn't test whether this also happens with COB scripts.
Additional InformationRun the attached Spring startscript (Zero-K v0.9). Compare buildings (e.g. pw_mine, pw_artefact) spawned by gadget before game start to those /given after game start.

Gadget in question: http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/LuaRules/Gadgets/unit_planetwars.lua
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • txt file icon script_pwtest.txt (4,344 bytes) 2011-11-25 14:22 -
    [game]
    {
    	[ai0]
    	{
    		[options]
    		{
    			aggressiveness=normal;
    			maphack=0;
    			maxgroupsize=10;
    			reporturl=http://myAIStats.myDomain.com/statsReceiver.cgi;
    			resourcebonous=0;
    		}
    		host=2;
    		isfromdemo=0;
    		name=Bot1;
    		shortname=NullAI;
    		team=0;
    		version=0.1;
    	}
    	[ai1]
    	{
    		[options]
    		{
    			aggressiveness=normal;
    			maphack=0;
    			maxgroupsize=10;
    			reporturl=http://myAIStats.myDomain.com/statsReceiver.cgi;
    			resourcebonous=0;
    		}
    		host=2;
    		isfromdemo=0;
    		name=Bot2;
    		shortname=NullAI;
    		team=1;
    		version=0.1;
    	}
    	[allyteam0]
    	{
    		numallies=0;
    		startrectbottom=0.995;
    		startrectleft=0.000;
    		startrectright=0.085;
    		startrecttop=0.000;
    	}
    	[allyteam1]
    	{
    		numallies=0;
    		startrectbottom=1.000;
    		startrectleft=0.890;
    		startrectright=0.995;
    		startrecttop=0.000;
    	}
    	[mapoptions]
    	{
    	}
    	[modoptions]
    	{
    		animation=0;
    		burrowqueentime=100;
    		burrowspawnrate=45;
    		chickenspawnrate=50;
    		commends=0;
    		coop=0;
    		cratermult=1;
    		damagemult=1;
    		disablefeatures=0;
    		disablemapdamage=0;
    		doesnotcountmode=destroy;
    		enableunlocks=0;
    		energymult=1;
    		factorycostmult=1;
    		fixedallies=1;
    		graceperiod=2.5;
    		gracetime=2;
    		hilltime=10;
    		marketandbounty=0;
    		maxspeed=2;
    		maxunits=1500;
    		maxwind=2.5;
    		metalmult=1;
    		miniqueentime=0.6;
    		minspeed=0.5;
    		minwind=0;
    		noceasefire=0;
    		queentime=60;
    		relayhoststartpostype=2;
    		sharemode=teammates;
    		shuffle=off;
    		specialdecloak=0;
    		specialpower=0;
    		startingresourcetype=facplop;
    		stayonteam=0;
    		techtimemult=1;
    		terracostmult=1;
    		typemapsetting=auto;
    		unitspeedmult=1;
    		waterlevel=0;
    		wreckagemult=1;
    		xmas=0;
    		zkmode=normal;
    		
    planetwarsstructures=ew0KICBkZWZlbmRlciA9IDAsDQogIHMxID0gew0KICAgIHVuaXRuYW1lID0gInB3X21pbmUiLA0KICAgIG5hbWUgPSAiTWluaW5nIG91dHBvc3QiLA0KICAgIGRlc2NyaXB0aW9uID0gIlByb2R1Y2VzIDUwIGNyZWRpdHMgZWFjaCB0dXJuIg0KICB9LA0KICBzMiA9IHsNCiAgICB1bml0bmFtZSA9ICJwd19taW5lMiIsDQogICAgbmFtZSA9ICJBdXRvbWF0ZWQgbWluZXMiLA0KICAgIGRlc2NyaXB0aW9uID0gIlByb2R1Y2VzIDE1MCBjcmVkaXRzIGVhY2ggdHVybiINCiAgfSwNCiAgczMgPSB7DQogICAgdW5pdG5hbWUgPSAicHdfbWluZTMiLA0KICAgIG5hbWUgPSAiQXV0b21hdGVkIG1pbmVzIiwNCiAgICBkZXNjcmlwdGlvbiA9ICJQcm9kdWNlcyAxNTAgY3JlZGl0cyBlYWNoIHR1cm4iDQogIH0sDQog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SINCiAgfSwNCiAgczk5ID0gew0KICAgIHVuaXRuYW1lID0gInB3X2FydGVmYWN0IiwNCiAgICBuYW1lID0gIkFuY2llbnQgYXJ0ZWZhY3RzIiwNCiAgICBkZXNjcmlwdGlvbiA9ICJDYXB0dXJlIGFsbCBzdWNoIHBsYW5ldHMgYW5kIGFsbCB0ZWNobm9sb2dpZXMgdG8gd2luLCBwcmV2ZW50cyBidXlpbmcgaW5mbHVlbmNlIGZyb20gbG9jYWxzIg0KICB9LCAgDQp9;
    
    	}
    	[player2]
    	{
    		countrycode=my;
    		isfromdemo=0;
    		name=Histidine;
    		rank=0;
    		spectator=0;
    		team=2;
    	}
    	[restrict]
    	{
    	}
    	[team0]
    	{
    		allyteam=1;
    		handicap=0;
    		rgbcolor=0.976471 1 0;
    		side=Robots;
    		teamleader=2;
    	}
    	[team1]
    	{
    		allyteam=0;
    		handicap=0;
    		rgbcolor=0.509804 0.498039 1;
    		side=Robots;
    		teamleader=2;
    	}
    	[team2]
    	{
    		allyteam=0;
    		handicap=0;
    		rgbcolor=0 0.501961 0;
    		side=Robots;
    		teamleader=2;
    		defender=1;
    	}
    	gametype=Zero-K v0.9;
    	hostip=;
    	hostport=8452;
    	ishost=1;
    	maphash=2940113655;
    	mapname=Green Comet Basic;
    	modhash=3645413567;
    	myplayername=Histidine;
    	numplayers=1;
    	numrestrictions=0;
    	numusers=3;
    	startpostype=2;
    }
    
    txt file icon script_pwtest.txt (4,344 bytes) 2011-11-25 14:22 +

-Relationships
related to 0002503closedKloot (master) unit scripts does not work on startunits, works on units created later 
has duplicate 0002464resolvedabma Any units given before game start in zero-k 0.8.7.2 are invisible 
+Relationships

-Notes

~0007698

user744

maybe this problem?
http://springrts.com/mantis/view.php?id=2503

~0007712

Kloot (developer)

duplicate of 0002503

~0007920

KingRaptor (reporter)

The gadget in question already had layer=1; changing to 2 or math.huge fails to resolve the issue.

~0007921

jK (developer)

Last edited: 2011-12-15 09:21

The problem was/is that one of your gadgets is crashing, and the current (gadget-widget-) handlers aren't safe against crashes while processing an event. So it can happen that not all addons recv. the event when another (earlier) one crashes.

Note, here the event was/is UnitCreated.

~0008117

abma (administrator)

please retry with a fixed lua script and reopen if it still fails...

/cheat
/give all works fine here when typed before game start (yes, you've to be quick... :)


please reopen, if it still fails.
+Notes

-Issue History
Date Modified Username Field Change
2011-11-25 14:22 KingRaptor New Issue
2011-11-25 14:22 KingRaptor File Added: script_pwtest.txt
2011-11-25 15:35 user744 Note Added: 0007698
2011-11-25 17:38 abma Relationship added related to 0002464
2011-11-25 17:38 abma Relationship added related to 0002503
2011-11-26 16:00 Kloot Note Added: 0007712
2011-11-26 16:00 Kloot Status new => closed
2011-11-26 16:00 Kloot Resolution open => duplicate
2011-12-15 06:00 KingRaptor Note Added: 0007920
2011-12-15 06:00 KingRaptor Status closed => feedback
2011-12-15 06:00 KingRaptor Resolution duplicate => reopened
2011-12-15 09:19 jK Note Added: 0007921
2011-12-15 09:20 jK Note Edited: 0007921
2011-12-15 09:21 jK Note Edited: 0007921
2012-01-10 00:10 abma Note Added: 0008117
2012-01-10 00:10 abma Status feedback => resolved
2012-01-10 00:10 abma Resolution reopened => no change required
2012-01-10 00:10 abma Assigned To => abma
2012-01-10 00:12 abma Relationship replaced has duplicate 0002464
+Issue History