enclave's WML Macros questions Thread
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.
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: enclave's WML Macros questions Thread
I've never used image_mod myself, but you don't seem to be using it right according to the wiki. It adds image path functions, but it looks like you are adding an image with a path function. It looks like you have to start with "BLIT". That may be why it's not working right.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: enclave's WML Macros questions Thread
I was just about to post that it worked just fine for me (I saw one corner of a camp wall), but what beetlenaut said makes perfect sense. It's kind of weird that I saw any part of it working at all. Anyway, in stderr you should see an "error display: error parsing image modifications: misc/blank-hex.png".
Re: enclave's WML Macros questions Thread
Yeah, thank you both very much, for all your time and efford!
I forgot to use BLIT with image_mod because I was trying it with "[unit] overlays=" before trying image_mod (and [unit_overlay], but it's same..)
and for me it worked perfect without blit as well, thats why I forgot it maybe it was error in middle of my screen, maybe not..
I was really sleepy that day and now I found my stupid mistake..
before I tried other things and one of them was this:
and after that it was this:
and of course I forgot to delete the "[unstore_unit]" part when I tried other things instead of "{VARIABLE" part..
so what was happening was that [object] probably was working perfectly fine (or maybe with error.. deleted by my [options] messages) but then as soon as i closed the messages the overlay was disappearing after [unstore_unit] to it's previous state (without image_mod)..
my silly silly silly silly mistake.. im so sorry for wasting your time..
thanks for pointing out at BLIT mistake.. I hoped it would fix my previous method:
but no, unfortunatey it doesnt work.. not sure what I do wrong about it
PS. found what I do wrong.. my code above has created 2 separate effects as if I wrote it like this:
the fix would look like this:
I forgot to use BLIT with image_mod because I was trying it with "[unit] overlays=" before trying image_mod (and [unit_overlay], but it's same..)
and for me it worked perfect without blit as well, thats why I forgot it maybe it was error in middle of my screen, maybe not..
I was really sleepy that day and now I found my stupid mistake..
before I tried other things and one of them was this:
Code: Select all
{VARIABLE cg_temp_action_unit.modifications.object.effect[$cg_temp_action_unit.modifications.object.effect.length].apply_to image_mod}
{VARIABLE cg_temp_action_unit.modifications.object.effect[$cg_temp_action_unit.modifications.object.effect.length].add "misc/blank-hex.png~BLIT(terrain\castle\encampment\tall-keep-convex-br.png~CROP(22,43,30,35)~SCALE(30,30),17,40)~BLIT(terrain/castle/encampment/tall-keep-concave-tr.png~CROP(52,54,58,63)~SCALE(39,39)~FL(horiz),21,30)"}
Code: Select all
[unstore_unit]
variable=cg_temp_action_unit
[/unstore_unit]
so what was happening was that [object] probably was working perfectly fine (or maybe with error.. deleted by my [options] messages) but then as soon as i closed the messages the overlay was disappearing after [unstore_unit] to it's previous state (without image_mod)..
my silly silly silly silly mistake.. im so sorry for wasting your time..
thanks for pointing out at BLIT mistake.. I hoped it would fix my previous method:
Code: Select all
{VARIABLE cg_temp_action_unit.modifications.object.effect[$cg_temp_action_unit.modifications.object.effect.length].apply_to image_mod}
{VARIABLE cg_temp_action_unit.modifications.object.effect[$cg_temp_action_unit.modifications.object.effect.length].add "BLIT(terrain\castle\encampment\tall-keep-convex-br.png~CROP(22,43,30,35)~SCALE(30,30),17,40)~BLIT(terrain/castle/encampment/tall-keep-concave-tr.png~CROP(52,54,58,63)~SCALE(39,39)~FL(horiz),21,30)"}
[unstore_unit]
variable=cg_temp_action_unit
[/unstore_unit]
PS. found what I do wrong.. my code above has created 2 separate effects as if I wrote it like this:
Spoiler:
Code: Select all
{VARIABLE cg_temp_arr_length $cg_temp_action_unit.modifications.object.effect.length}
{VARIABLE cg_temp_action_unit.modifications.object.effect[$cg_temp_arr_length].apply_to image_mod}
{VARIABLE cg_temp_action_unit.modifications.object.effect[$cg_temp_arr_length].add "BLIT(terrain\castle\encampment\tall-keep-convex-br.png~CROP(22,43,30,35)~SCALE(30,30),17,40)~BLIT(terrain/castle/encampment/tall-keep-concave-tr.png~CROP(52,54,58,63)~SCALE(39,39)~FL(horiz),21,30)"}
{CLEAR_VARIABLE cg_temp_arr_length}
[unstore_unit]
variable=cg_temp_action_unit
[/unstore_unit]
Re: enclave's WML Macros questions Thread
Anyone knows if there is a way to make separate [movement_costs] for road terrain type?
I mean for example so that unit on flat would have 3mp cost but only 1mp cost on road.?
I mean for example so that unit on flat would have 3mp cost but only 1mp cost on road.?
Re: enclave's WML Macros questions Thread
Assuming mp-nodownload, no. But it might be possible to create such portals like teleport uses.
Re: enclave's WML Macros questions Thread
No, not possible.enclave wrote:Anyone knows if there is a way to make separate [movement_costs] for road terrain type?
I mean for example so that unit on flat would have 3mp cost but only 1mp cost on road.?
Re: enclave's WML Macros questions Thread
Thanks very much Ravana and zookeeper, saved me a lot of time trying to find it somewhere in help.
I will try to workaround it using filter location and modifying moves then.. not sure how it will work, but time will tell.
A new question..
I have ability like this:
and it shows ability 2 times on my unit.. but both resistances have same id.. shouldn't it only show 1? like leadership (level1, level2, level3.. etc)
What am I doing wrong?
PS. tried to put cumulative=yes and cumulative=no , no changes..
PPS. I still don't know what I did wrong, but i solved my problem just by removing all following name and description.. like so:
I will try to workaround it using filter location and modifying moves then.. not sure how it will work, but time will tell.
A new question..
I have ability like this:
Code: Select all
[abilities]
[resistance]
active_on=defense
add=25
apply_to="blade"
description="Fortified unit has 25% Increased Resistance"
id="cg_fortified"
max_value=100
name="fortified"
[/resistance]
[resistance]
active_on=defense
add=20
apply_to="arcane"
description="Fortified unit has 25% Increased Resistance"
id="cg_fortified"
max_value=100
name="fortified"
[/resistance]
[/abilities]
What am I doing wrong?
PS. tried to put cumulative=yes and cumulative=no , no changes..
PPS. I still don't know what I did wrong, but i solved my problem just by removing all following name and description.. like so:
Spoiler:
Re: enclave's WML Macros questions Thread
I was playing with advance and post advance events and found wiki description a bit misleading.. or maybe I still havent figured out what I'm doing wrong..
I have advance event where I use store/unstore unit
in this case advance event is not happening, while unit actually levels.. I find it strange.. as wiki says:
According to author I select the advancement choice and then it is aborted.. is it?
I spent bloody ages looking for problem with my simple code.. and I still dont 100% get what I do wrong..
I have advance event where I use store/unstore unit
in this case advance event is not happening, while unit actually levels.. I find it strange.. as wiki says:
I guess the author of wiki meant that post advance event is aborted (not advancement itself)? if the unit was removed via [unstore_unit]? Or I just have no idea what is going on.. my post advance just not happens at all.. in case of using [unstore_unit] in advance event on same unit.advance
Triggers just before the primary unit is going to advance to another unit, or advance by AMLA. (This is after the player selects which advancement, if there is a choice). If this event removes the unit, changes the unit's type, or reduces the unit's experience below what it needs to advance, then the advancement is aborted. This also applies to advancement by AMLA.
According to author I select the advancement choice and then it is aborted.. is it?
I spent bloody ages looking for problem with my simple code.. and I still dont 100% get what I do wrong..
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: enclave's WML Macros questions Thread
[unstore_unit] has advance= and fire_event=. I'm not sure if it's your problem, but check the information about those.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: enclave's WML Macros questions Thread
The worst part is that those default to a case that one usually never wants: The default is fire_event=no and advance=yes which means that the unit will advance but the advance events will not be fired. to get a useful behaviour you shodula dd fire_event=yes or advance=no to [unstore_unit].
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: enclave's WML Macros questions Thread
lol.. thanks so much beetlenaut and gfgtdf!
I already sorted my problem by changing the code and removing unstore from advance but the solution was so simple... silly me..
so i guess basically, these things are needed if you want to force unit to advance.. then you can just change his experience into max_experience and unstore it.. nice to know as well.. may be useful some day lol.. i just killed 3 hours of my life yesterday
I already sorted my problem by changing the code and removing unstore from advance but the solution was so simple... silly me..
so i guess basically, these things are needed if you want to force unit to advance.. then you can just change his experience into max_experience and unstore it.. nice to know as well.. may be useful some day lol.. i just killed 3 hours of my life yesterday
Re: enclave's WML Macros questions Thread
Hi again! Some rather advanced questions:
1) anyone managed to make select event work in 1.12 ? (in multiplayer games) without OOS?
I mean is there way to synchronize the game state with lua or something..?
2) any wml to temporarily modify the cursor image during multiplayer game?
1) anyone managed to make select event work in 1.12 ? (in multiplayer games) without OOS?
I mean is there way to synchronize the game state with lua or something..?
2) any wml to temporarily modify the cursor image during multiplayer game?
Re: enclave's WML Macros questions Thread
1) By only making UI changes, oos wont happen.
Re: enclave's WML Macros questions Thread
Sorry, Im very bad at abriviations.. "UI changes" means?
I want to make range attacks over couple hexes simplier than right-click unit (choose "select this unit to shoot") and then right click enemy unit.. (select "shoot")
for example just by selecting a unit via mouse click and then right click enemy unit to select "shoot"..
basically something that would always store a selected unit and then use it if needed..
so if I selected a unit he would be [store_unit] stored...
and then attack was performed via stored unit damage and strikes to right click menu unit..
Im quite sure it would change the game state... or am I wrong...
I would maybe also like an image near my mouse pointer.. of something related to shooting.. but I haven't decided what exactly I want.. it will all depend on what I actually can do.. trying to figure out the tools available first..
I want to make range attacks over couple hexes simplier than right-click unit (choose "select this unit to shoot") and then right click enemy unit.. (select "shoot")
for example just by selecting a unit via mouse click and then right click enemy unit to select "shoot"..
basically something that would always store a selected unit and then use it if needed..
so if I selected a unit he would be [store_unit] stored...
and then attack was performed via stored unit damage and strikes to right click menu unit..
Im quite sure it would change the game state... or am I wrong...
I would maybe also like an image near my mouse pointer.. of something related to shooting.. but I haven't decided what exactly I want.. it will all depend on what I actually can do.. trying to figure out the tools available first..