New script event for skirmish - CALL_START_NEXT_LEVEL

For AI and campaign script related discussions and questions
Post Reply
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

New script event for skirmish - CALL_START_NEXT_LEVEL

Post by Per »

There is a particularly nasty bug in the script system related to the CALL_GAMEINIT event. When it is called, several of the in-game data structures are not properly set up yet, so some functions will fail mysteriously. Calling functions from this event is therefore not recommended.

The script event CALL_START_NEXT_LEVEL has been used throughout the campaign scripting, but never for skirmish. So what I did was to add code to the forthcoming 2.3 release candidate to fire off this event once the map is fully loaded. You can put the things you perhaps had planned for CALL_GAMEINIT in this event instead.

In related news, I fixed the script bug when getNearestGateway() is called on a map with no gateways. It should also be in the 2.3 release candidate.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: New script event for skirmish - CALL_START_NEXT_LEVEL

Post by DylanDog »

Good idea opening this forum. Thanks for fixing the getNearestGateway().
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
Post Reply