Problems with end scenario events

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
User avatar
Vendanna
Posts: 624
Joined: September 16th, 2006, 10:07 pm
Location: Spain

Problems with end scenario events

Post by Vendanna »

Don't know why it happens, and while I'm scratching my head searching on the wiki, and the forum (without success) I don't manage to find what I'm doing wrong.

On the map your character (no recruitment tower on all the map) finds a Leader of the Pack wolf (AI leader) that should try to chew on you and that you can either try to defeat, or simply reach the other part of the map in order to win.

Problem, the AI leader each turn will ignore your character and simply try to reach the 1,1 square of the map.

Why this happens? How can I solve that? even if I copy the enemy side from other campaings it always do the same and so I'm lost. (can be because there is no recruiting place on the map?)
[side]
type=Wolf
description=Wolf
user_description=_ "Leader of the Pack"
side=2
canrecruit=1
controller=ai
[ai]
passive_leader=no
caution=0
aggression=1
leader_value=4
[target]
description=Thug
value=2
[/target]
[avoid]
x=1
y=1
[/avoid]
[/ai]
[/side]
Last edited by Vendanna on February 23rd, 2008, 9:39 pm, edited 1 time in total.
"Mysteries are revealed in the light of reason."
User avatar
Vendanna
Posts: 624
Joined: September 16th, 2006, 10:07 pm
Location: Spain

Post by Vendanna »

If there's a keep, the AI works without problems, its only if there isn't any keep that the AI starts to do weird things.

Probably because it isn't supposed to be maps without keeps on the game?
"Mysteries are revealed in the light of reason."
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

Don't make this guy a leader, then. Or make sure the side has absolutely no gold.

Really, leaders do strange things - they always run towards a keep if they can recruit. That nearest keep location probably defaults to 0,0 or 1,1 if it can't find any. ;)
User avatar
Vendanna
Posts: 624
Joined: September 16th, 2006, 10:07 pm
Location: Spain

Post by Vendanna »

Ok, I'll try to do so. But I'll write what I want to do on the scenario just in case some weird problem happens or I need to do something out of the norm.

Between, that shouldn't have counted as a bug?

Scenario Start

Main Character appears offscreen and reachs target location. (doable with fakemoveunit as explained in the wiki)

Hears wolf sounds, and talks about it (not too much problem).

young woodsman appears from the other side of the screen and yells for help, three modified wolves appears after him.

Then first turn begin.

The Objetive of the scenario is to reach the other side of the level before turns runs out, without main character dying.

You can try to save the boy from the wolves (enemy) tought it is not mandatory that you either kill the wolves or the child survives.

If there is still any wolves and you reach the other part of the map, you leave and child is left on his own.

(campaing must remember child died)

If you killed all three wolves, child starts conversation, gives bow to the main character (permanently gains new attack) and scenario ends.

(also need to add an state so the campaing remember this happened probably for the end scenario).

That's the planning for this scenario. I'll post later the cfg if I come with problems.
"Mysteries are revealed in the light of reason."
User avatar
Vendanna
Posts: 624
Joined: September 16th, 2006, 10:07 pm
Location: Spain

Post by Vendanna »

Ok, the scenario is shaping nicely, and following your advice, these wolves aren't leader, so they act as they are expected to (and devour me in the process)

Now, I've a problem envisioning how to do the last part of the scenario (when it ends) since there seems to be a decent amount of things to account for. (that's what happens when you want to tell a tale like the choose your own adventure books) :P

The cases are:

A - Main char reaches the right extreme of the map, Tommy and any wolf are alive. (Tommy should be killed by the remaining wolves) (Event 1)

B - Main char reaches the right extreme of the map, Tommy is dead and there are still wolves remaining. (Event 2)

C - Main char reaches the right extreme of the map, Tommy is dead and there aren't any wolves remaining. (Event 3)

D - Tommy is alive and all the wolves have been slain. (Event 4)

E - Main Character turns coward and leaves from where he came for (if Tommy is alive he isn't outright killed and you go to other map) (Event 5)

Also, since the character was cursed on the introductory scenario, I want him to turn into stone upon the event of "defeat for reaching time limit" tought don't know how to do it.

I tried this simple approach, but it failed as I was expecting it to be not that simple. (also probably required a filter)

Code: Select all

	[event]
		name=time over
		[message]
			speaker=Ryan
			message= _ "My flesh is turning into stone! Nooooo!"
		[/message]
		[stone]
		[filter]
		description=Ryan
		[/filter]
		[/stone]
		[heal]
		[/heal]
		[message]
			speaker=narrator
			message= _ "In the end, the curse took its toy on our hero."
		[/message]
		[endlevel]
			result=defeat
		[/endlevel]
	[/event]
"Mysteries are revealed in the light of reason."
User avatar
Vendanna
Posts: 624
Joined: September 16th, 2006, 10:07 pm
Location: Spain

Post by Vendanna »

Well, well, well. It seems I managed to advance a little bit, tought I'm still struggling to get the desired effects.

What I have managed to do.

A - Main char reaches the right extreme of the map, Tommy and any wolf are alive. (Tommy should be killed by the remaining wolves) (Event 1)
Didn't get any progress here :(

B - Main char reaches the right extreme of the map, Tommy is dead and there are still wolves remaining. (Event 2)
there is only an event of win if you reach the right part of the level irregardless of having wolves or tommy being saved or not

C - Main char reaches the right extreme of the map, Tommy is dead and there aren't any wolves remaining. (Event 3)
same as above

D - Tommy is alive and all the wolves have been slain. (Event 4)
Finally when side=2 is killed, the scenario ends, and if tommy is alive he gives its bow

E - Main Character turns coward and leaves from where he came for (if Tommy is alive he isn't outright killed and you go to other map) (Event 5)
not yet coded wml wise

I'm having problems because I don't know how to code these to work as they should, specially the cases in which the wolves should devour poor tommy if you leave any wolf alive upon reaching end destination. :?
Attachments
1_If_That_Wasnt_Enough.cfg
updated scenario.cfg
(5.44 KiB) Downloaded 115 times
"Mysteries are revealed in the light of reason."
User avatar
Vendanna
Posts: 624
Joined: September 16th, 2006, 10:07 pm
Location: Spain

Post by Vendanna »

Well, managed finally to get the unit stoned upon death :D

Progression rather slow due to inexperience with the wml, and I still need to try again to make the different effects upon scenario ends.

Still, I'm happy to have learned a little about it, thank you. :)
"Mysteries are revealed in the light of reason."
Post Reply