'kill'= misleading name
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.
- Simons Mith
- Posts: 821
- Joined: January 27th, 2005, 10:46 pm
- Location: Twickenham
- Contact:
'kill'= misleading name
An idle observation, if I may:
While kill= is often used to kill units, it's also used for unit modifications (e.g. stopping a fight partway, as in another recent thread). Wouldn't it be less misleading if this ever so commonly-used function was called 'remove' instead? If you save a unit's current state, then 'kill' it, then restore it, then you didn't really 'kill' it in the first place. I appreciate that making such a wide-reaching change is somewhat unlikely, but from a coding viewpoint I definitely would prefer to use 'remove' and 'restore' when that's what I'm doing, and only use 'kill' when I really mean 'kill'. Alternatively, what's the opinion of having aliases for commands, or having a new 'remove' command that 'saves-and-'kills'' while the 'kill' command just 'kills', as now?
While kill= is often used to kill units, it's also used for unit modifications (e.g. stopping a fight partway, as in another recent thread). Wouldn't it be less misleading if this ever so commonly-used function was called 'remove' instead? If you save a unit's current state, then 'kill' it, then restore it, then you didn't really 'kill' it in the first place. I appreciate that making such a wide-reaching change is somewhat unlikely, but from a coding viewpoint I definitely would prefer to use 'remove' and 'restore' when that's what I'm doing, and only use 'kill' when I really mean 'kill'. Alternatively, what's the opinion of having aliases for commands, or having a new 'remove' command that 'saves-and-'kills'' while the 'kill' command just 'kills', as now?
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: 'kill'= misleading name
personally i like it the way it is now fine, just because the death is 'temporary' doesn't mean that it didn't die.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- Captain_Wrathbow
- Posts: 1664
- Joined: June 30th, 2009, 2:03 pm
- Location: Guardia
Re: 'kill'= misleading name
I'm afraid I don't see much of a problem with the current way, either.
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: 'kill'= misleading name
I kind of see where you're coming from, but using kill=yes inside store_unit kills it just as much as by any other means (barring firing events and animation). There's no difference between the two scenarios below. Indeed, kill=yes replaces the basic function of [kill].
Code: Select all
# scenario 1
[store_unit]
variable=unit
[filter]
x,y=1,1
[/filter]
[/store_unit]
[kill]
x,y=1,1
[/kill]
[unstore_unit]
variable=unit
[/unstore_unit]
# scenario 2
[store_unit]
variable=unit
[filter]
x,y=1,1
[/filter]
kill=yes
[/store_unit]
[unstore_unit]
variable=unit
[/unstore_unit]
Re: 'kill'= misleading name
I don't see a problem with [kill]'s name. The only problem I see with it is that animate=yes doesn't show a death animation, only a fade.
"What do you mean, "a dwarvish dragonguard with marksman is overpowered"?"
Story of a Drake Outcast | The Nonsense Era
Played HttT-Underground Channels? Thought it was rubbish? Help us develop it here!
Story of a Drake Outcast | The Nonsense Era
Played HttT-Underground Channels? Thought it was rubbish? Help us develop it here!
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: 'kill'= misleading name
However, it may be nice to support fire_event=yes|no and animate=yes|no if kill=yes. The name kill makes more sense then since you can actually see the unit die.
@Simons Mith Make the thread title better, I thought of [kill] too at first.
EDIT
https://gna.org/patch/?2031
@Simons Mith Make the thread title better, I thought of [kill] too at first.
EDIT
https://gna.org/patch/?2031
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
- Captain_Wrathbow
- Posts: 1664
- Joined: June 30th, 2009, 2:03 pm
- Location: Guardia
Re: 'kill'= misleading name
That's the default death animation when a custom one isn't specified in the unitfile. At this point most units don't have custom death animations, so fading out is the unit's death anim. IIRC, death anims aren't very high priority for the artists right now...Reepurr wrote:The only problem I see with it is that animate=yes doesn't show a death animation, only a fade.
But this is a completely different topic.
Re: 'kill'= misleading name
you could add a remove order including no-death animation. it would be allmost similar to kill.
My Temple Project: http://forums.wesnoth.org/viewtopic.php?f=23&t=29800
This is "must-play" campaign! Don´t read the thread, unless you need help. http://forums.wesnoth.org/viewtopic.php?f=8&t=31895
This is "must-play" campaign! Don´t read the thread, unless you need help. http://forums.wesnoth.org/viewtopic.php?f=8&t=31895
Re: 'kill'= misleading name
Ahem...Tet wrote:you could add a remove order including no-death animation. it would be allmost similar to kill.
Code: Select all
[lua]
code = <<
local function handler(t)
wesnoth.fire("kill",
{ animate = "no", fire_event = t.event })
end
wesnoth.register_wml_action("remove", handler)
>>
[/lua]
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.
Re: 'kill'= misleading name
You have lost a bit of data in the process, so it would probably remove all the units from the map. And by default, there are no death animations, so there is a simpler way to get a [remove] tag:LightFighter wrote:Now you have a [remove] tag.
Code: Select all
wesnoth.register_wml_action("remove", function(cfg) wesnoth.fire("kill", cfg) end)
Code: Select all
local old_kill = wesnoth.register_wml_action("kill", function(cfg)
local cfg = cfg.__literal
cfg.animate = true
cfg.fire_event = true
old_kill(cfg)
end)
wesnoth.register_wml_action("remove", old_kill)