[base_unit]
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.
[base_unit]
I've decided to use [base_unit] to re-use animations, but I have a few questions (and problems) about how it works.
my new Peasant Magician: http://pastebin.com/f415f0b13
stock 1.3.16 Peasant: http://pastebin.com/f785e8876
Problem:
-Though the [attack_anim]'s filters are quite specific, in-game, the missile attack's animation consists of both a magic missile flying at the target, and a pitchfork flying below it....
Questions:
-How does the game interpret what to replace and what to add? Are the original attacks just ignored? (that's how it seems to work)
-Is the idle animation inherited? I haven't seen it yet.
my new Peasant Magician: http://pastebin.com/f415f0b13
stock 1.3.16 Peasant: http://pastebin.com/f785e8876
Problem:
-Though the [attack_anim]'s filters are quite specific, in-game, the missile attack's animation consists of both a magic missile flying at the target, and a pitchfork flying below it....
Questions:
-How does the game interpret what to replace and what to add? Are the original attacks just ignored? (that's how it seems to work)
-Is the idle animation inherited? I haven't seen it yet.
Re: [base_unit]
Use an image=misc/blank-hex.png in the [missile_frame] to overwrite any other image= it might otherwise get, either by default or from the inheritance.AI wrote:Problem:
-Though the [attack_anim]'s filters are quite specific, in-game, the missile attack's animation consists of both a magic missile flying at the target, and a pitchfork flying below it....
I don't know the details of how the inheritance works exactly for animations. Regardless, I think using [base_unit] in this case seems a bit funny since the unit is pretty different from the base and because you're actually not using the inheritance feature a lot (you define a lot of things that are identical to how they appear in the peasant...).
I know, all I did so far was cut out the animations (since they change a lot)
The reason I didn't delete much more is because I wasn't sure how much'd be inherited.
for example:
Peasant has melee pitchfork and ranged pitchfork
Peasant magician using base_unit has melee pitchfork and ranged missile
the resulting unit has melee pitchfork and ranged missile
does this mean that
-a new ranged attack replaces old ranged attacks
-any new attack definitions replace all previous ones
-attacks aren't inherited in the first place
as you can see the inheritance system isn't very clear and the wiki doesn't say much either.
The reason I didn't delete much more is because I wasn't sure how much'd be inherited.
for example:
Peasant has melee pitchfork and ranged pitchfork
Peasant magician using base_unit has melee pitchfork and ranged missile
the resulting unit has melee pitchfork and ranged missile
does this mean that
-a new ranged attack replaces old ranged attacks
-any new attack definitions replace all previous ones
-attacks aren't inherited in the first place
as you can see the inheritance system isn't very clear and the wiki doesn't say much either.
-
- Art Contributor
- Posts: 410
- Joined: October 30th, 2006, 4:55 am
- Location: The Big Ö (a.k.a. Austria)
AIAIK, when you inherit from a base_unit, it essentially copies that unit's cfg file, then overwrites each thing you specify in the new one. So if the base has, say, resistances of 10 to blade and 30 to impact, and you specify only impact=50, you'll get a unit with 10 blade and 50 impact resist. For attacks, I believe it overwrites them in order, and if you want to add a new one you have to add empty [attack] tags to tell it not to mess with the preexisting ones.
that little girl's parents were attacked by ninjas - generic npc
hee hee! - little girl
hee hee! - little girl
The inheritance works the same for the animation tags as for any other. You need to count the animations frames, and use empty tags to copy them directly, or use invalid keys to invalidate them.
Really, this kind of copying gets messy - when the original unit changes, all your animation hacking is going to do strange things, too.
Really, this kind of copying gets messy - when the original unit changes, all your animation hacking is going to do strange things, too.
Try some Multiplayer Scenarios / Campaigns