[kill] not working

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
SkeleRanger
Posts: 151
Joined: August 12th, 2008, 11:10 pm
Location: The Isle of Alduin

[kill] not working

Post by SkeleRanger »

Code: Select all

[event]
	name=moveto
	first_time_only=no
	[filter]
		type=Peasant Child
		x=1
		y=30
	[/filter]
	[kill]
		x,y=1,30
		animate=no
		fire_event=no
	[/kill]
	{VARIABLE_OP children add -1}
	[if]
		[variable]
			name=children
			equals=0
		[/variable]
		[then]
			{CHILD_SAFE}
		[/then]
		[else]
		[/else]
	[/if]
[/event]
In 1.4 the unit would disappear. In 1.5 the unit does not disappear. It's annoying. I think I will go nuts if I can't figure out why this isn't working. Help please...

I also tried x=1 then y= 30 instead of x,y=1,30 and tried putting them in [filter] tags.
'We've strayed into a zone with a high magical index... Don't ask me how. Once upon a time a really powerful magic field must have been generated here, and we're feeling the after-effects.'
'Precisely,' said a passing bush.
--Terry Pratchett
Tale of a Mage(finished)
Art for Tale of a Mage
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: [kill] not working

Post by DEATH_is_undead »

SkeleRanger wrote:

Code: Select all

[event]
	name=moveto
	first_time_only=no
	[filter]
		type=Peasant Child
		x=1
		y=30
	[/filter]
	[kill]
		x,y=1,30
		animate=no
		fire_event=no
	[/kill]
	{VARIABLE_OP children add -1}
	[if]
		[variable]
			name=children
			equals=0
		[/variable]
		[then]
			{CHILD_SAFE}
		[/then]
		[else]
		[/else]
	[/if]
[/event]
In 1.4 the unit would disappear. In 1.5 the unit does not disappear. It's annoying. I think I will go nuts if I can't figure out why this isn't working. Help please...

I also tried x=1 then y= 30 instead of x,y=1,30 and tried putting them in [filter] tags.
Whats variable Children?
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
User avatar
TrashMan
Posts: 601
Joined: April 30th, 2008, 8:04 pm
Contact:

Re: [kill] not working

Post by TrashMan »

A variable in which he stores the number of children that reached the escape point.
Light travels much faster than sound, that's why some people seem bright until you hear them speak.

>>> MY LITTLE LAB! <<<
SkeleRanger
Posts: 151
Joined: August 12th, 2008, 11:10 pm
Location: The Isle of Alduin

Re: [kill] not working

Post by SkeleRanger »

Well, technically its the number of children that still need to reach the escape point :wink: , but yeah what TrashMan said. When all the children escape trigger the victory/beat_the_crud_out_of_Slinian message. I'm pretty sure this still works but it makes no sense if the kid's still there.
'We've strayed into a zone with a high magical index... Don't ask me how. Once upon a time a really powerful magic field must have been generated here, and we're feeling the after-effects.'
'Precisely,' said a passing bush.
--Terry Pratchett
Tale of a Mage(finished)
Art for Tale of a Mage
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: [kill] not working

Post by Anonymissimus »

you've changed the generated unit type to "Peasant ChildNA", but not the type filtered on
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
SkeleRanger
Posts: 151
Joined: August 12th, 2008, 11:10 pm
Location: The Isle of Alduin

Re: [kill] not working

Post by SkeleRanger »

Anonymissimus wrote:you've changed the generated unit type to "Peasant ChildNA", but not the type filtered on
:annoyed: I feel really stupid now. Thanks for your help.
'We've strayed into a zone with a high magical index... Don't ask me how. Once upon a time a really powerful magic field must have been generated here, and we're feeling the after-effects.'
'Precisely,' said a passing bush.
--Terry Pratchett
Tale of a Mage(finished)
Art for Tale of a Mage
Post Reply