Re: Dynamic Script Usage
Could someone help my or give my some suggestions what i can do?
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Occurs when a house is destroyed. If DestroyerIndex is -1 the house was destroyed some other way, such as from Actions.HouseDestroy. If DestroyerIndex is the same as the house owner (States.HouseOwner), the house was demolished by the player who owns it. Otherwise it was destroyed by an enemy. Called just before the house is destroyed so HouseID is usable only during this event
if KillQueue[QueueWalker].RecordDesiredAction = 'KillEmptyUnit' then begin
ThatUnitType := KillQueue[QueueWalker].RecordStuff; // has unittype stored
ThatUnitX := KillQueue[QueueWalker].RecordUnitX;
ThatUnitY :=KillQueue[QueueWalker].RecordUnitY;
if ThatUnitType < 14 then begin
EmptyUnit := Actions.GiveUnit(PLAYER_1,ThatUnitType,ThatUnitX,ThatUnitY,States.KamRandomI(8));
end;
if ThatUnitType >= 14 then begin
EmptyGroup := Actions.GiveGroup(PLAYER_1,ThatUnitType,ThatUnitX,ThatUnitY,States.KamRandomI(8),1,1);
EmptyUnit := States.GroupMember(EmptyGroup,0);
end;
Actions.UnitKill(EmptyUnit,false);
end;
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
How did you fix it in the end? Maybe other people here will benefit from your answer?
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
This was part of my earlier mentioned exploding vagabonds. A killed vagabond (onUnitKilled) would generate a circle of instantly dying units around it. However, with onUnitDied, all dying units (even though they have no killerID) in this circle would ALSO trigger this procedure, which generates dying units in a circle, which triggers the procedure, etc etc etc. So just by checking if OnUnitDied has a KillerID other than -1 fixed it. Actually very simple and logical...How did you fix it in the end? Maybe other people here will benefit from your answer?
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Could the length for dynamic scripts be increased? Because KAM Remake gives me the error 'ERangeError: Range check error' as soon as the 'length' of the .script file gets longer than 65533. I have verified this, because just removing/adding a comment can make the mission crash upon startup, which makes no sense to me.
Yes I know that a length of > 65533 is ridiculously long, but I am making serious work of the scripted map competition and I have dozens of custom procedures doing pretty advanced stuff, so I need the .script file to be longer. Please?...
Would you be able to send us a script file which causes it to crash on startup so we can test it? Hopefully we'll be able to remove this limitation
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Users browsing this forum: No registered users and 5 guests
Powered by phpBB® Forum Software © phpBB Group Designed by ST Software |
![]() |