macro to deadvance unit. any way to trim?
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.
-
- Posts: 16
- Joined: April 15th, 2009, 10:10 am
macro to deadvance unit. any way to trim?
I am trying to make a macro to deadvance a unit. The only way I can think of to do it is using lots of [case] tags:
I am having to write several unit ids manually for each advancing unit.
is there any way I could cut the amount of writing down?
RETYPE_UNIT FILTER TYPE is a macro I defined.
Code: Select all
[case]
value=red_mage,white_mage
{RETYPE_UNIT id={UNIT}.id mage}
[case]
is there any way I could cut the amount of writing down?
RETYPE_UNIT FILTER TYPE is a macro I defined.
Re: macro to deadvance unit. any way to trim?
No, something like that is the only way. However all the WML you have there seems to be completely bogus.ducklord_time wrote:I am trying to make a macro to deadvance a unit. The only way I can think of to do it is using lots of [case] tags:
I am having to write several unit ids manually for each advancing unit.Code: Select all
[case] value=red_mage,white_mage {RETYPE_UNIT id={UNIT}.id mage} [case]
is there any way I could cut the amount of writing down?
RETYPE_UNIT FILTER TYPE is a macro I defined.
Re: macro to deadvance unit. any way to trim?
Lastbreath is to Death as ??? is to Advance.
Is there such a thing that goes in place of the ???'s ? If so store the unit right before it advances, reset its exp and unstore...
Is there such a thing that goes in place of the ???'s ? If so store the unit right before it advances, reset its exp and unstore...
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: macro to deadvance unit. any way to trim?
Right, it depends what and when ducklord means by "deadvance." The advance event fires before a unit advances and a post_advance event fires after the advance, so, if you just want to prevent a unit from advancing, then gambit is on the right track. Just store the unit on advance and then unstore on post_advance.Gambit wrote:Lastbreath is to Death as ??? is to Advance.
Is there such a thing that goes in place of the ???'s ? If so store the unit right before it advances, reset its exp and unstore...
Re: macro to deadvance unit. any way to trim?
Ah well, I assumed he wanted it to work whenever for any unit, not just when a unit advances, since...of course he would have said so if that would have been the case, right?
Re: macro to deadvance unit. any way to trim?
In a standard scenario one can only recruit level ones. So I assumed the only way to get a higher level unit would be to... advance?
I agree. He needs to elaborate more on the exact usage/implimentation.
I agree. He needs to elaborate more on the exact usage/implimentation.
-
- Posts: 16
- Joined: April 15th, 2009, 10:10 am
Re: macro to deadvance unit. any way to trim?
My intention was to define a unit which, when it attacked, reduced the experience of the unit it attacked. If the experience were reduced below 0, the unit it attacked would be turned into something which could advance into it. I intended to make an attacker_hits event which stored unit2 and then called this macro on the variable:
etc
other WML I made to facilitate it is:
I see now that I need to put $ and | signs in the filters. What else is wrong with the WML?
Spoiler:
other WML I made to facilitate it is:
Spoiler:
Re: macro to deadvance unit. any way to trim?
You forgot to put a # at the beginning of enddef. Also, I find that I have to match the capitalization of the ID of units, but it might just be for using the recruit list. It wouldn't hurt to do it anyways.
I might look more into your WML later.
I might look more into your WML later.
I'm just... a guy...
I'm back for now, I might get started on some work again.
I'm back for now, I might get started on some work again.
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: macro to deadvance unit. any way to trim?
MODIFY_UNIT is used to alter an unstored unit. Using it in that event, where it the unit is automatically stored, wouldn't work with the rest of your code in the event. Just use {VARIABLE unit.variables.amla_count 1}.
Which brings me to my next note: why are you manipulating "unit1"?
You don't want this. Take the [not]s out and put in not_equals=1.
AFAIK, you can't put multiple values for cases, like you have here:
value=necromancer,lich
I've tested it a few versions ago (probably 1.5.6-ish) and it didn't work then, so unless it has changed, it won't work.
That's probably not everything. I just skimmed the code and picked out the obvious stuff.
Which brings me to my next note: why are you manipulating "unit1"?
Code: Select all
[not]
[variable]
name=unit1.variables.amla_count
boolean_equals=1
[/variable]
[/not]
AFAIK, you can't put multiple values for cases, like you have here:
value=necromancer,lich
I've tested it a few versions ago (probably 1.5.6-ish) and it didn't work then, so unless it has changed, it won't work.
That's probably not everything. I just skimmed the code and picked out the obvious stuff.
Re: macro to deadvance unit. any way to trim?
So wait a minute... just to paraphrase to make sure I understand, you want a unit that can go around hopping through the forest bopping units on the head and de-evolving them?
-
- Posts: 16
- Joined: April 15th, 2009, 10:10 am
Re: macro to deadvance unit. any way to trim?
A Guy wrote:You forgot to put a # at the beginning of enddef. Also, I find that I have to match the capitalization of the ID of units, but it might just be for using the recruit list. It wouldn't hurt to do it anyways.
I might look more into your WML later.
Ken_Oh wrote:MODIFY_UNIT is used to alter an unstored unit. Using it in that event, where it the unit is automatically stored, wouldn't work with the rest of your code in the event. Just use {VARIABLE unit.variables.amla_count 1}.
Which brings me to my next note: why are you manipulating "unit1"?
You don't want this. Take the [not]s out and put in not_equals=1.Code: Select all
[not] [variable] name=unit1.variables.amla_count boolean_equals=1 [/variable] [/not]
AFAIK, you can't put multiple values for cases, like you have here:
value=necromancer,lich
I've tested it a few versions ago (probably 1.5.6-ish) and it didn't work then, so unless it has changed, it won't work.
That's probably not everything. I just skimmed the code and picked out the obvious stuff.
Thanks.
The [not] tags rather than "not_equals" were because I wanted it to test if the variable had been set at all, and I wasn't sure if "not_equals" would do that. Should I make a recruit event to set it to zero?
yes.Gambit wrote:So wait a minute... just to paraphrase to make sure I understand, you want a unit that can go around hopping through the forest bopping units on the head and de-evolving them?
Re: macro to deadvance unit. any way to trim?
keeping with the little bunny foofoo reference; down came the sugarplum fairy and she said
sounds like a cool idea. can't wait to play it. let us know when its working and uploaded
sounds like a cool idea. can't wait to play it. let us know when its working and uploaded