load_game_failed: ... empty unit

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
Nosmos
Posts: 46
Joined: September 27th, 2006, 9:41 am

load_game_failed: ... empty unit

Post by Nosmos »

The Game could not be loaded: load_game_failed: Attempt to de-serialize an empty unit
Thats the error i get from a scenario.

The Scenario should work like this :
5 Sides
Side 1 is the ai
Side 2,3 Team 1
Side 4,5 Team 2
Both Teams have their own box and try to survive spawns of ai units (side 1).
A team wins when the 2 leaders from the other team die.

The code looks like this :
[multiplayer]
id=multiplayer_2vs2Survival
name= _ "2vs2 - Survival"
map_data="{@campaigns/2vs2Survival/2vs2Survivalmap}"
description= _ "2 vs 2 Survival Map
50 % experience # 2 gold per villiage
default era # use map settings
no fog/shroud # unlimited turns"
turns="-1"
experience_modifier=50%
objectives="
Victory:
@Death of enemy leaders
Defeat:
#Death of your leaders
Settings : 50% experience # 2 gold per village
default era # use map settings
no fog # unlimited turns"

[side]
description=Computer
side=1
canrecruit=0
controller=ai
team_name=Attacker
allow_player=false
gold=100
no_leader=yes
[ai]
aggression=0.8
[/ai]
[/side]

[side]
description=Team 1
side=2
enemy=4,5
canrecruit=1
controller=human
team_name=Team 1
gold=75
income=2
[/side]

[side]
description=Team 1
side=3
enemy=4,5
canrecruit=1
controller=human
team_name=Team 1
gold=75
income=2
[/side]

[side]
description=Team 2
side=4
enemy=2,3
canrecruit=1
controller=human
team_name=Team 2
gold=75
income=2
[/side]

[side]
description=Team 2
side=5
enemy=2,3
canrecruit=1
controller=human
team_name=Team 2
gold=75
income=2
[/side]
I Have tried many combinations of canrecruit=1 or 0, with enemy=1,2, with no_leader=no or yes but the mistake always was there. I think only the Winner gets it.
Its under 1.2.5.
The winning conditions work fine (victory_when_enemies_defeated is default yes so i didnt put that in)

Perhaps someone can help :)
User avatar
governor
Posts: 267
Joined: December 8th, 2006, 12:32 am

Post by governor »

At a glance: there is no [/multiplayer] at eof.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Not to mention these unterminated strings:

Code: Select all

description= _ "2 vs 2 Survival Map
50 % experience # 2 gold per villiage
default era # use map settings
no fog/shroud # unlimited turns"

Code: Select all

objectives="
Victory:
@Death of enemy leaders
Defeat:
#Death of your leaders
Settings : 50% experience # 2 gold per village
default era # use map settings
no fog # unlimited turns" 
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

governor wrote:At a glance: there is no [/multiplayer] at eof.
He didn't post the whole file... :?

I'd try setting a type key for the AI side, even if you have a no_leader=yes setting. A missing type broke things for me before...
EDIT: it's probably allow_player=false that prevents a type being pre-set from the game creation screen...
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Rhuvaen wrote:He didn't post the whole file... :?
Well, that'd be the preferred recipe for not getting anything fixed...
Nosmos
Posts: 46
Joined: September 27th, 2006, 9:41 am

Post by Nosmos »

I already tried type= but it didnt had an effect
hm good idea, will try it without allow_player=false

I dont see any reason to post the rest of the code, has nothing to do with the problem
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Nosmos wrote:I dont see any reason to post the rest of the code, has nothing to do with the problem
I'll believe you when you bet your own head on that.
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

zookeeper wrote:
Nosmos wrote:I dont see any reason to post the rest of the code, has nothing to do with the problem
I'll believe you when you bet your own head on that.
Well, since he knows that the rest of the file has nothing to do with the problem, he must already know what the problem is. Nothing to see here. Move along...
Nosmos
Posts: 46
Joined: September 27th, 2006, 9:41 am

Post by Nosmos »

#define SPAWN TYPE X Y
[unit]
side=1
type={TYPE}
x={X}
y={Y}
[/unit]

#enddef

#define MITTE TYPE
{SPAWN {TYPE} 10 11}
{SPAWN {TYPE} 26 11}
#enddef

#define WASSER TYPE
{SPAWN {TYPE} 6 16}
{SPAWN {TYPE} 14 14}
{SPAWN {TYPE} 22 14}
{SPAWN {TYPE} 30 16}
#enddef


#define WELLE ZUG EINHEIT
[event]
name=turn {ZUG}
{EINHEIT}
[/event]
#enddef

#define SET_LABEL TEXT X Y
[label]
x={X}
y={Y}
text={TEXT}
[/label]
#enddef

#define LABEL TEXT
{SET_LABEL {TEXT} 18 17}
#enddef


[multiplayer]
id=multiplayer_2vs2Survival
name= _ "2vs2 - Survival"
map_data="{@campaigns/2vs2Survival/2vs2Survivalmap}"
description= _ "2 vs 2 Survival Map
50 % experience # 2 gold per villiage
default era # use map settings
no fog/shroud # unlimited turns"
turns="-1"
experience_modifier=50%
objectives="
Victory:
@Death of enemy leaders
Defeat:
#Death of your leaders
Settings : 50% experience # 2 gold per village
default era # use map settings
no fog # unlimited turns"
{DAWN}
{MORNING}
{AFTERNOON}
{DUSK}
{FIRST_WATCH}
{SECOND_WATCH}


[side]
description=Computer
side=1
canrecruit=0
controller=ai
team_name=Attacker
allow_player=false
gold=100
no_leader=yes
[ai]
aggression=0.8
[/ai]

[/side]
[side]
description=Team 1
side=2
enemy=4,5
canrecruit=1
controller=human
team_name=Team 1
gold=75
income=2
[/side]
[side]
description=Team 1
side=3
enemy=4,5
canrecruit=1
controller=human
team_name=Team 1
gold=75
income=2
[/side]
[side]
description=Team 2
side=4
enemy=2,3
canrecruit=1
controller=human
team_name=Team 2
gold=75
income=2
[/side]
[side]
description=Team 2
side=5
enemy=2,3
canrecruit=1
controller=human
team_name=Team 2
gold=75
income=2
[/side]


[event]
name=turn 26
#Mitte geht auf
[terrain]
x=16,20
y=9,9
letter=g
[/terrain]
[terrain]
x=16,20
y=10,10
letter=J
[/terrain]
[terrain]
x=16,20
y=11,11
letter=d
[/terrain]
[terrain]
x=16,16,20,20
y=12,13,12,13
letter=c
[/terrain]
[terrain]
x=16,20
y=14,14
letter=g
[/terrain]
[/event]



{WELLE 1 {LABEL "Turn 2 : Elves"}}
{WELLE 2 {MITTE "Elvish Fighter"}{MITTE "Elvish Shaman"}{MITTE "Elvish Fighter"}{MITTE "Elvish Shaman"}{LABEL "Turn 4 : Scouts"}}
{WELLE 4 {MITTE "Cavalryman"}{MITTE "Elvish Scout"}{MITTE "Drake Glider"}{MITTE "Drake Glider"}{LABEL "Turn 6 : Nagas"}}
{WELLE 6 {WASSER "Naga Fighter"}{WASSER "Naga Fighter"}{LABEL "Turn 8 : Loyalists"}}
{WELLE 8 {MITTE "Heavy Infantryman"}{MITTE "Spearman"}{MITTE "Fencer"}{MITTE "Fencer"}{MITTE "Mage"}{MITTE "Bowman"}{LABEL "Turn 11 : Outlaws & Gryphons"}}
{WELLE 11 {MITTE "Outlaw"}{MITTE "Trapper"}{MITTE "Rogue"}{MITTE "Trapper"}{WASSER "Gryphon Rider"}{LABEL "Turn 14 : Drakes & Merman"}}
{WELLE 14 {WASSER "Merman Warrior"}{MITTE "Drake Flare"}{MITTE "Drake Fighter"}{MITTE "Drake Clasher"}{MITTE "Saurian Skirmisher"}{MITTE "Saurian Soothsayer"}{LABEL "Turn 17 : Undead"}}
{WELLE 17 {WASSER "Shadow"}{MITTE "Revenant"}{MITTE "Revenant"}{WASSER "Vampire Bat"}{MITTE "Necrophage"}{MITTE "Necrophage"}{LABEL "Turn 20 : Sorceress & Friends"}}
{WELLE 20 {MITTE "General"}{MITTE "Lancer"}{MITTE "Lancer"}{MITTE "Elder Wose"}{MITTE "Elder Wose"}{MITTE "Elvish Sorceress"}{LABEL "Turn 23 : Monsters"}}
{WELLE 23 {WASSER "Sea Serpent"}{WASSER "Cuttle Fish"}{MITTE "Giant Spider"}{MITTE "Giant Spider"}{MITTE "Giant Scorpion"}{MITTE "Giant Scorpion"}{MITTE "Gryphon"}{MITTE "Gryphon"}{LABEL "Turn 26 : The Middle opens"}}

[/multiplayer]
ok if you think that will help ;)
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

That scenario starts just fine for me (meaning no errors, I don't know about the rest) on 1.3.4+svn. I did remove the silly description= and objectives= keys though.
User avatar
governor
Posts: 267
Joined: December 8th, 2006, 12:32 am

Post by governor »

You are passing macro expansions as macro paramaters (which *can* be a bad habit since WML macros do not expand inline).

This means that:

Code: Select all

{WELLE 23 {WASSER "Sea Serpent"}{WASSER "Cuttle Fish"}{MITTE "Giant Spider"}{MITTE "Giant Spider"}{MITTE "Giant Scorpion"}{MITTE "Giant Scorpion"}{MITTE "Gryphon"}{MITTE "Gryphon"}{LABEL "Turn 26 : The Middle opens"}} 
..will not expand properly.

Try encapsulating your list with ( and ) to make sure that you are only passing 2 parameters to the WELLE macro.

I.E.


{WELLE 23 ({WASSER "Sea Serpent"}{WASSER "Cuttle Fish"}{MITTE "Giant Spider"}{MITTE "Giant Spider"}{MITTE "Giant Scorpion"}{MITTE "Giant Scorpion"}{MITTE "Gryphon"}{MITTE "Gryphon"}{LABEL "Turn 26 : The Middle opens"})}


Hope this helps, and of course it would need to be applied to all your macro "calls".
Nosmos
Posts: 46
Joined: September 27th, 2006, 9:41 am

Post by Nosmos »

zookeeper wrote:That scenario starts just fine for me (meaning no errors, I don't know about the rest) on 1.3.4+svn. I did remove the silly description= and objectives= keys though.
I dont understand why they are silly but removing them did just remove the description and the objectives. The Winner still got that error.
governor wrote: Hope this helps, and of course it would need to be applied to all your macro "calls".
Ok i did that but i never had problems with this stuff. It also worked in other scenarios without a problem.

I think the problem has something to do with red, no_leader and that the game end when both leaders of 1 team die. But i also tried it with a red leader and with canrecruit=1 the winning conditions dont work
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

Nosmos wrote:I think the problem has something to do with red, no_leader and that the game end when both leaders of 1 team die. But i also tried it with a red leader and with canrecruit=1 the winning conditions dont work
Can you post the scenario "head" (id=, turns= etc) and the side definitions again, including what you tried to change? I'm mostly interested in your settings for this, and not the events. :wink:

Do I understand correctly that the error happens right at the start?
Nosmos
Posts: 46
Joined: September 27th, 2006, 9:41 am

Post by Nosmos »

Rhuvaen wrote: Can you post the scenario "head" (id=, turns= etc) and the side definitions again, including what you tried to change? I'm mostly interested in your settings for this, and not the events. :wink:

Do I understand correctly that the error happens right at the start?
nope in the end
and only the winner gets it (next problem i found that if you are in the winning team but lost the leader you get a "you have been defeated" message)
Post Reply