View Full Version : Mysterious non-working event


CurtSibling
Mar 11, 2011, 04:50 PM
This event refuses to trigger, and I cannot see why?
The city is definitely spelt correctly...Frankly I am stumped.
Or I am missing something rather obvious...Can anyone assist?

@IF
CITYTAKEN
city=Port Ironteeth
attacker=ANYBODY
defender=Foes
@THEN
JUSTONCE
TEXT
^
^^ A mighty War Kruiser is seized at Port Ironteeth's dry dock!
^
ENDTEXT
CREATEUNIT
unit=War Kruiser
owner=TriggerAttacker
veteran=yes
homecity=None
locations
201,183
201,185
201,187
endlocations
PlayWaveFile
HERALD.wav
@ENDIF

...

Catfish
Mar 11, 2011, 06:37 PM
No problem with event structure. If the city name is correct, that leaves Defender and Unit names. Debug mode should tell you that. Have you exceeded your memory limit?

CurtSibling
Mar 12, 2011, 12:14 AM
All the other events (apart from one) seem to work fine.
And they have the same structure...:)

Hmm...Debug time!

CurtSibling
Mar 12, 2011, 12:17 AM
Debug entry...

@IF found - creating new event structure
New event structure created

@IF CITYTAKEN found
looking for [continuous],city=,attacker=,defender=
found city=Port Ironteeth
found attacker=ANYBODY (king id=-3)
found defender=Foes (king id=0)
@THEN found

@THEN JUSTONCE found
not looking for anything else here

@THEN TEXT found
looking for [no broadcast],ENDTEXT
found ENDTEXT

@THEN CREATEUNIT found
looking for unit=,owner=,veteran=,homecity=,[incapital],locations,endlocations,[count=]
found unit=War Kruiser (unit id=65)
found owner=TriggerAttacker (king id=-3)
found homecity=None
found locations
found location 0: 201, 183, 0 (map=0)
found location 1: 201, 185, 0 (map=0)
found location 2: 201, 187, 0 (map=0)
found endlocations

@THEN PLAYWAVEFILE found, looking for file name
found wave file name HERALD.wav
@ENDIF found

And at the end:

"remaining heap space: 24925 bytes"

It's weird - I cannot see a reason why it won't trigger...:(

CurtSibling
Mar 12, 2011, 12:48 AM
Strangely - I changed the names of these barb cities with "civcity" app, and now they work...

Perhaps having cities with similar names (3 x cities with "Port Something") caused a bug?

Dunno! Works now - :)

McMonkey
Mar 12, 2011, 03:25 AM
I had problems when there was a space after the city name in the city screen. After removing the extra space the events worked. Could this have been the problem if the event is working after a rename?

CurtSibling
Mar 12, 2011, 11:00 AM
Nicely spotted, sir!

I am going to check the names of the barb cities tonight, I reckon this might be the bug!

:D

Catfish
Mar 12, 2011, 03:40 PM
That could be it. I just tested it and the debugger was insensitive to spaces at the ends of names.