tekelili advanced WML questions
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.
Re: tekelili WML noob questions
Overlays aren't shown when viewing the recall list, this inconvenience was bugging me for long.
The appearance of units on the map can be changed by assigning it different animations (via [object]) for standing, moving and selected (and maybe also for other things), but not for those on the recall list. In this case, I suppose that ImagePathFunctionWML will still work (add it via [object] -> [effect] -> apply_to=image_mod, see the wiki for details), so you can use blank-hex.png as ~MASK to erase the unit's image and then use ~BLIT to paste the image of another unit over it (this might have to be removed after recalling the unit and returned to all units that might be recalled).
The appearance of units on the map can be changed by assigning it different animations (via [object]) for standing, moving and selected (and maybe also for other things), but not for those on the recall list. In this case, I suppose that ImagePathFunctionWML will still work (add it via [object] -> [effect] -> apply_to=image_mod, see the wiki for details), so you can use blank-hex.png as ~MASK to erase the unit's image and then use ~BLIT to paste the image of another unit over it (this might have to be removed after recalling the unit and returned to all units that might be recalled).
- pyrophorus
- Posts: 533
- Joined: December 1st, 2010, 12:54 pm
Re: tekelili WML noob questions
Excuse me but, [variation] don't work for you ?
I'm pretty sure the modifications appear even in the recall list.
Friendly,
I'm pretty sure the modifications appear even in the recall list.
Friendly,
HowTos: WML filtering, WML variables
Re: tekelili WML noob questions
I am confussed, isnt [variation] a subtag from [unit_type]? And wiki says [variation] dont accept [variation] subtags, wouldnt do this impossible display walking corpses overlayed? Sorry if I am wrong, trying to learnpyrophorus wrote:Excuse me but, [variation] don't work for you ?
I'm pretty sure the modifications appear even in the recall list.
Friendly,
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II
- pyrophorus
- Posts: 533
- Joined: December 1st, 2010, 12:54 pm
Re: tekelili WML noob questions
It would be creating variations of your unit (in the unit_type) holding its different pictures. Switching between variations on real units would make them show accordingly, even in the recall list.
HTH
HTH
HowTos: WML filtering, WML variables
Re: tekelili WML noob questions
Variation is not a good solution. It is worse than another unit_type, in fact. Every saved unit contains all its possible variations, an entirely new unit_type creates instances of units that are much shorter (because of this, Walking Corpses and Soulless can easily occupy most of the size of save files if you use plague too much). I am not sure if tekelili wasn't trying to give them appearance according to variables, but that can't be done via variations.
Re: tekelili WML noob questions
DoneDugi wrote:And tekelili, maybe you could rename your topic, these are no longer noob questions (when you made a developer err in his post).
From now I had only succes with effect, apply_to=image_mod (other ways could fail due to my unskill or just didnt tried them because I had some kind of doubt). However this was a "meh" succes, as overlay was shown only in the side image of recall menu, and not over the unit image directly inside recall list. It showed also some slow perfomance and an almost error (I had to click over "empty variable value image from debug").
Edit
I feel explain my problem in detail can help:
In my campaign units get a trait "trained" that can vary a lot in its effect. To help players to keep track of most powerfull trained units, I let them add an is_special overlay. As traits effects are not displayed in recall menu, here becomes even more usefull have an is_special overlay to point important units. I am adding "!!" to units names as temporal solution, something like this
Code: Select all
{FOREACH iotd_recall_store i}
[if]
[variable]
name=iotd_recall_store[$i|].overlays
contains="is_special.png"
[/variable]
[then]
{VARIABLE iotd_recall_store[$i|].name "$iotd_recall_store[$i|].name !!"}
[/then]
[unstore_unit]
variable=iotd_recall_store[$i]
x,y=recall
[/unstore_unit]
{NEXT i}
{CLEAR_VARIABLE iotd_recall_store}
EDIT: Units overlays are shown in recall menu in versiosn 1.11, I rather wont complicate anymore my life with this issue in 1.10
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II
Re: tekelili advanced WML questions
I want to change all hex in a map with terrain Xu to random value among "Uu","Uh","Uu^Uf".
As I dont dominate syntax, I wonder if this can be done with a single terrain tag
As I dont dominate syntax, I wonder if this can be done with a single terrain tag
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II
Re: tekelili advanced WML questions
Untested:tekelili wrote:I want to change all hex in a map with terrain Xu to random value among "Uu","Uh","Uu^Uf".
As I dont dominate syntax, I wonder if this can be done with a single terrain tag
Code: Select all
[store_locations]
terrain=Xu
variable=terrain_to_change
[/store_locations]
{FOREACH terrain_to_change i}
{RANDOM (Uu, Uu, Uu, Uh, Uu^Uf)} # you can add here more than one terrain-code to change the hit possibility
[terrain]
x=$terrain_to_change[$i].x
y=$terrain_to_change[$i].y
terrain=$random
[/terrain]
{NEXT i}
{CLEAR_VARIABLE terrain_to_change}
Last edited by Adamant14 on January 1st, 2014, 10:06 pm, edited 2 times in total.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: tekelili advanced WML questions
Ty Adamant14. I just writed RANDOM inside loop and worked
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II
Re: tekelili advanced WML questions
Yes you are right, the random must be inside the loop.
Sorry for that.
I edited my post above.
Sorry for that.
I edited my post above.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: tekelili advanced WML questions
I have tried to learn from other add ons how to declare scenarios for 1.11 but I was unable. What should I change from this 1.10 code to work on 1.11?
_main.cfg/scenarios/Wc_tek_Start.cfg
_main.cfg
Code: Select all
#ifdef MULTIPLAYER
[binary_path]
path=data/add-ons/World_Conquest_tek
[/binary_path]
{~add-ons/World_Conquest_tek/WC_tek_Era/_main.cfg}
{~add-ons/World_Conquest_tek/utils}
{~add-ons/World_Conquest_tek/scenarios}
#endif
Code: Select all
[multiplayer]
id=World_Conquest_tek
name= _ "3p WC tek"
map_generation=default
description=_"A randomly generated cooperative multiplayer campaign for 1-3 players. It has 5 scenarios and 5 level of difficulties."
[generator]
{WORLD_CONQUEST_TEK_GENERATOR 35 20 5 8000 3 4 2}
[scenario]
id=World_Conquest_tek_Start
name= _ "World Conquest tek"
next_scenario=WC_tek_Island2
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II
Re: tekelili advanced WML questions
Nothing.tekelili wrote:I have tried to learn from other add ons how to declare scenarios for 1.11 but I was unable. What should I change from this 1.10 code to work on 1.11?
Unless you want it to be recognized as a campaign, in which case your _main.cfg becomes something like the following:
Code: Select all
[campaign]
id=mp_campaign_World_Conquest_tek
name= _ "World Conquest"
abbrev= _ "WC"
define=MP_CAMPAIGN_WC_tek
difficulties=EASY,NORMAL,HARD,NIGHTMARE
first_scenario=World_Conquest_tek
description= _ "A randomly generated cooperative multiplayer campaign for 1-3 players. It has 5 scenarios and 5 level of difficulties."
type=mp
min_players=1
max_players=3
[/campaign]
#ifdef MP_CAMPAIGN_WC_tek
[binary_path]
path=data/add-ons/World_Conquest_tek
[/binary_path]
{~add-ons/World_Conquest_tek/WC_tek_Era/_main.cfg}
{~add-ons/World_Conquest_tek/utils}
{~add-ons/World_Conquest_tek/scenarios}
#endif
In general, the syntax follows standard campaign wml.
Re: tekelili advanced WML questions
When a player uses recall option, he can select any unit in his recall list. When he picks his option, if he has less than 20 gold then he gets a message that informs recall cant be done... but is storaged player´s option in any variable at that moment, that I can acces from wml?
Edit: I am starting to realiaze that answer to my question is probably "no"... so side questions: can I detect from wml every time players open the recall menu? can I fire from wml the recall menu?
Edit: I am starting to realiaze that answer to my question is probably "no"... so side questions: can I detect from wml every time players open the recall menu? can I fire from wml the recall menu?
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II
Re: tekelili advanced WML questions
Not if he hits cancel or lacks gold to recall.can I detect from wml every time players open the recall menu?
No, the only way to do it needs a complex workaround, so complex that it's better not to do it unless the reason for it is really serious.can I fire from wml the recall menu?
Re: tekelili advanced WML questions
Thanks Dugi (and also to other answers, thanks guys for help).
A very simple doubt about pango: I want convert "Resistances" into "resistances" using pango, it is possible?
I triedbut doesnt look do anything.
Edit: if no possible with pango, anyway to convert a string to lower case would help me.
A very simple doubt about pango: I want convert "Resistances" into "resistances" using pango, it is possible?
I tried
Code: Select all
"<span variant='smallcaps'>"+_ "Resistances"+"</span>"
Edit: if no possible with pango, anyway to convert a string to lower case would help me.
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II