Confusing error
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.
Confusing error
Yesterday, I started updating the WML in Wesvoid. When I killed something with Emeric in the scenario in which Emeric becomes a zombie, the game quit and I got this error message in the terminal. I have no idea what this means.
Consequently, I can't fix this problem. Please help. Is more information required?
Code: Select all
wesnoth: unit_map.cpp:55: void unit_map::add(std::pair<gamemap::location, unit>*): Assertion `res.second' failed.
Aborted
That error message looks familiar, and the game rarely quits on you, so I'm going to guess that this is related to a bug I discovered two days ago... check to make sure that each of the sides is distinct - the game will crash if there are multiple side=1s (or 2s, or 3s, etc) in a scenario.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
No, I couldn't find any extra sides, and I don't see how that could be the problem. The game quits and says IN THE TERMINAl,
Here is the {EMERICS_BODY_KILLS} WML:
Here is the new Emerics Body unit file:
Here is the map for the scenario:
Please help fix Wesvoid.
when Emeric's Body kills something. Here is the scenario file:wesnoth: unit_map.cpp:55: void unit_map::add(std::pair<gamemap::location, unit>*): Assertion `res.second' failed.
Aborted
Code: Select all
#textdomain wesnoth-Wesvoid
[scenario]
{UPGRADE_WESVOID_IF_NEEDED}
{EMERIC_RECRUITS (Mage,{@<1 Spearman})}
{EMERICS_BODY_KILLS}
#[story]
# [part]
# #background=wesvoid-story-5-1.png
# story= _ "Emeric returned to the Isle of Anduin to begin the dark ritual."
# [/part]
#[/story]
name= _ "The Ritual of Crelanu's Book"
{SCENARIO_MAP Ritual}
victory_when_enemies_defeated=no
turns={@ 10 9 8}
{AFTERNOON}
{DUSK}
{FIRST_WATCH}
{SECOND_WATCH}
{DAWN}
{MORNING}
id=The_Ritual_of_Crelanus_Book
next_scenario=Chase_the_Villain
#frantic.ogg
[side]
save_id=Emeric
type=Silver Mage
description=Emeric
side=1
canrecruit=1
controller=human
team_name=mages
[/side]
[side]
side=2
no_leader=yes
team_name=enemies
recruit=Wesvoid Drake Slave,Wesvoid Drake Worker
{GOLD 80 100 120}
[ai]
recruitment_pattern=fighter
#,fighter,fighter,fighter,archer
caution=0.0
passive_leader=yes
grouping=no
aggression=0.9
{NO_SCOUTS}
[/ai]
#special effects
[ai]
turns=1
[leader_goal]
x,y=5,41
[/leader_goal]
[avoid]
x,y=4,36
[/avoid]
[/ai]
[ai]
turns=1,2
[avoid]
x,y=5,34
[/avoid]
[/ai]
[/side]
[side]
no_leader=yes
side=3
team_name=mages
[ai]
#be careful: don't attack the ones that fight back, mostly
aggression=-0.5
#don't move onto my keep, you fools!
[avoid]
x,y=10,34
[/avoid]
#don't go into reckless danger!
[avoid]
x,y=1-7,1-41
[/avoid]
[/ai]
#don't charge forwards right away!
[ai]
time_of_day=afternoon,dusk
[avoid]
x,y=1-9,1-41
[/avoid]
[/ai]
[/side]
#define COWARDLY_SIDE SIDE_NUMBER TARGET_X TARGET_Y
[side]
no_leader=yes
side={SIDE_NUMBER}
controller=ai
colour=3
[ai]
[leader_goal]
x={TARGET_X}
y={TARGET_Y}
[/leader_goal]
passive_leader=yes
[/ai]
gold=0
income=-20
team_name=mages
[/side]
{LOCAL coward_locs_{SIDE_NUMBER}_x {TARGET_X}}
{LOCAL coward_locs_{SIDE_NUMBER}_y {TARGET_Y}}
[event]
name=moveto
[filter]
x={TARGET_X}
y={TARGET_Y}
[/filter]
[store_unit]
[filter]
side={SIDE_NUMBER}
[/filter]
variable=cowards_store
[/store_unit]
{IN cowards_store}
{SET[] side 3}
{UNSTORE[]}
{/IN}
{RESET cowards_store}
[/event]
#enddef
{COWARDLY_SIDE 4 10 29}
{COWARDLY_SIDE 5 14 30}
{COWARDLY_SIDE 6 14 34}
{COWARDLY_SIDE 7 12 37}
{COWARDLY_SIDE 8 18 34}
{COWARDLY_SIDE 9 22 32}
#mutinous necromancer's side
[side]
no_leader=yes
side=10
colour=4
team_name=mages
[ai]
aggression=1.0
caution=0.0
[/ai]
[/side]
#a dummy side for the necromancer at first
[side]
no_leader=yes
side=11
colour=2
team_name=enemies
[ai]
[/ai]
[/side]
[side]
no_leader=yes
side=12
colour=4
team_name=enemies
[ai]
[/ai]
[/side]
[side]
no_leader=yes
side=13
colour=5
team_name=hostile_to_everyone
[ai]
aggression=0.75
caution=0.1
grouping=no
[/ai]
[/side]
#I'm sure I don't *need* all of these sides, but I'm not going to bother reducing the number.
#in particular, I believe sides 10 and 12 are unused because they were part of a
#no-longer-existant plot
#it was getting too clumsy for one file
{./Ritual/start.cfg}
{./Ritual/enemies_dancing.cfg}
{./Ritual/evil_appearance.cfg}
{./Ritual/mage_event_ai}
{STANDARD_WIZARDS_COUNCIL_DEATHS}
[event]
name=die
[filter]
description=Seimus
[/filter]
[message]
description=Seimus
message= _ "No! I have lost the battle and failed to regain my castle!"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
{EMERIC_UNDEAD_DEATHS}
[event]
name=moveto
[filter]
description=Emeric's Body
x,y=2,35
[/filter]
[message]
description=Emeric
message= _ "On board! Now we can chase that terrible Void Master!"
[/message]
[message]
description=Delfador
message= _ "We shall go with you."
[/message]
[message]
description=Seimus
message= _ "I must remain at my castle."
[/message]
[message]
description=Darian
message= _ "But the rest of the council shall go."
[/message]
{STORE_WIZARDS_COUNCIL}
[endlevel]
result=victory
bonus=yes
[/endlevel]
[/event]
[/scenario]
Code: Select all
#textdomain wesnoth-Wesvoid
#define EMERICS_BODY_KILLS
[event]
name=die
first_time_only=no
[filter]
[not]
race=undead
[/not]
[/filter]
[filter_second]
description=Emeric's Body
[/filter_second]
[store_locations]
x=$x1
y=$y1
#all the types of villages (no longer true, ugh)
terrain=ZYtvVD
variable=is_village
[/store_locations]
[if]
{OR_VAR emerics_body_has_killed = yes}
{OR_VAR is_village.x > 0}
#note ELSE
[else]
{SET emerics_body_has_killed yes}
#artificially do the plaguing so it looks right when the message is displayed
#{STORE_PRIMARY_UNIT}
[kill]
x,y=$x1,$y1
[/kill]
[unit]
side=1
type=Emeric's Body
description=Emeric's Body
user_description= _ "Emeric's Body"
overlays=hero-shield.png
unrenamable=yes
moves=-1
resting=no
x,y=$x1,$y1
[/unit]
[redraw]
[/redraw]
[message]
description=Emeric
message= _ "I see my body has replicated itself! Now I only need to make sure to protect one of them."
[/message]
#but then put the state back to how it was so that normal plague/killing can take place
#no, need special plague? ?? because of special attributes
#{UNSTORE primary_unit}
[/else]
[/if]
{RESET is_village}
[/event]
#enddef
Code: Select all
#textdomain wesnoth-Wesvoid
#new graphics?
[unit]
id=Emeric's Body
name= _ "Zombie"
race=undead
image=soulless.png
hitpoints={@ 35 30 25}
movement_type=undeadfoot
movement={@ 6 5 4}
level=1
alignment=chaotic
advanceto=null
{AMLA_NECROHEAL}
cost=11
usage=fighter
unit_description= _ "After having the spirit ripped straight out of it, the remaining body has, oddly, gained the ability to imbue its victims' corpses with the essence of its identity."
{DEFENSE_ANIM "soulless-defend.png" "soulless.png" zombie-hit.wav }
[death]
[animation]
[frame]
begin=0
end=200
image=soulless-die-1.png
[/frame]
[frame]
begin=200
end=400
image=soulless-die-2.png
[/frame]
[frame]
begin=400
end=600
image=soulless-die-3.png
[/frame]
[/animation]
[/death]
[attack]
name=staff
type=impact
range=melee
damage=7
number=2
[specials]
{WEAPON_SPECIAL_PLAGUE}
[/specials]
[animation]
direction=se,sw,ne,nw
[frame]
begin=-200
end=100
image=soulless-attack.png
[/frame]
[/animation]
[animation]
direction=n
[frame]
begin=-200
end=100
image=soulless-attack-n.png
[/frame]
[/animation]
[animation]
direction=s
[frame]
begin=-200
end=100
image=soulless-attack-s.png
sound=zombie-attack.wav
[/frame]
[/animation]
[/attack]
[/unit]
Code: Select all
ssssssssssssssssssssssssssssssss
sssssssssssssssssccsssssssssssss
ssscccssssssssssccccssssssssssss
sscccccssssssscccddccsccccssssss
sccddcccsssssccccgddcccccccccsss
ccdggdccscccscddcggddccdddcccsss
sccdtdccccccccdgcgggddddddddccss
sccdgdcccdddcdgtcggggddggdddccss
sccdggdcdgggcdgccggtggggggddccss
ccdggggdgfggcggcggggggggfffddccs
ccdgggtggffgcgccgggggggffffgddcc
ccdtgggggggtcgcgggggggtffffgddcc
sccdgffgggggcccgggggggffffffdccs
sccdggggtggggccgtgggggftftffdccs
scccdggggfggffcgggggtfffffffddcc
sccdtgfgggfgggcgggggffffffffddcc
ccdggggfggggtgccmmmfffffffffgddc
ccdgggfggggggmmcmmmffffffgggddcc
scctgggggthhmmmccmmmfftfftggddcs
scddgghhghhhmmccccmmggggggggdcss
ssdgggggghhhmmcccccmmhgggggfgdcs
sssddgggghhhmmcccccmmhgggggffdcs
sssssdtggghhhmmccccmmhggggggftdc
sssssddggtghhmmcccmmmggggggggtdc
sssssssdgggghmmcccmmtggggggggddc
sssssssdgggghhmmmmmmggggtgggdccs
sssssssdggggghhmtmmmgggggggdcsss
ssssssssdggggghhmmmggggggggdcsss
ssssssssdtgggggghhhggggggggdcsss
sssdddsdgggggtggggggggggggdcssss
ssdgggddgggggggggggfgggggggdcsss
sdgggggggggggggfffffftgggtggdsss
ssdCCCtggggggggffffffggggggdssss
ssdC1Cgggrgggtgfftfffffggggdssss
scdCCCgggggggdgffffffgfggggdssss
sdgtggtgggggdsdffffffgggggggdsss
ssdggddggggtdsdffffdddgggggdssss
sssddsddggggdsdfffddssdggddsssss
ssssssssdggddssdfdsssssddsssssss
sssssssssddsdsssdsssssssssssssss
ssssssssssssssssssssssssssssssss
Do you see the message displayed before the game quits, or not?
I think it must have something to do with the plague ability and changing/killing the victim in the die event. Something (probably the plague code) tries to add a unit onto the map but the unit gets lost (maybe because the victim IS changed to an undead beforehand?).
I'd try moving the whole stuff into an attack_end event (which happens before die), check if the first unit is killed (has negative hp), then do that stuff. Or just leave everything to the plague ability, and just change the unit's image in the die/attack_end event? I don't know if that'd work.
I think it must have something to do with the plague ability and changing/killing the victim in the die event. Something (probably the plague code) tries to add a unit onto the map but the unit gets lost (maybe because the victim IS changed to an undead beforehand?).
I'd try moving the whole stuff into an attack_end event (which happens before die), check if the first unit is killed (has negative hp), then do that stuff. Or just leave everything to the plague ability, and just change the unit's image in the die/attack_end event? I don't know if that'd work.
Try some Multiplayer Scenarios / Campaigns
-
- Retired Developer
- Posts: 1086
- Joined: September 16th, 2005, 5:44 am
- Location: Hamburg, Germany
A C++ map stores key-value pairs. In this case, the keys are locations (that is hexes on a map) and the value is a unit.
The code that causes the error is trying to add such a pair of hex/unit and it does a test first (a so called assertion, that makes the program quit if it fails). "res.second" describes the second part of the pair, that is the unit.
Like Rhuvaen said, it looks like a unit is missing there. If that doesn't help you get along i will take a closer look at that code and see if i can find out something.
The code that causes the error is trying to add such a pair of hex/unit and it does a test first (a so called assertion, that makes the program quit if it fails). "res.second" describes the second part of the pair, that is the unit.
Like Rhuvaen said, it looks like a unit is missing there. If that doesn't help you get along i will take a closer look at that code and see if i can find out something.
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
Yes, please file a report in the bug tracker. Scenario WML shouldn't be able to crash wesnoth. I can't look at it right now, but if yogi doesn't get to it before me, I'll fix it sometimes this weekend.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."