Recruit Variation Macro -- and boarding ships.
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.
Recruit Variation Macro -- and boarding ships.
I am trying to use this code below to run a test on a idea for my faction... having a cheap reserve unit that may be a crap level 0, or maybe a level 1 or 2. The example below is short and very heavily weighed, so I could see results. But I am getting an error, telling me there are 11 exceptions and it expected 3.
It works with zombies. But I realize I am trying to use different unit types..... Is it a possibility to due something with an after recruit test where some get enough experience points to advance to the next level(s)?
-----
I am trying to use some of the ships to do a naval battle. How (using the plague feature) can I have a ship killed by Boarding Party switch sides? Mechanical is immune and I don't won't floating zombies. A die event filtered by unit type, then by mode of death-- but I don't know how to set this up. And instead of being at full health only be at 10hp (hp= 1 crew) to represent a small prize crew?
I also have a problem with ships spawning on castle keeps if you don't assign them a water keep. Any ideas on how to avoid this from the recruit phase?
Spoiler:
-----
I am trying to use some of the ships to do a naval battle. How (using the plague feature) can I have a ship killed by Boarding Party switch sides? Mechanical is immune and I don't won't floating zombies. A die event filtered by unit type, then by mode of death-- but I don't know how to set this up. And instead of being at full health only be at 10hp (hp= 1 crew) to represent a small prize crew?
Spoiler:
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Recruit Variation Macro -- and boarding ships.
For the first one, you need to put the third argument in quotes. Otherwise it thinks that every space represents the start of a new argument.
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
Re: Recruit Variation Macro -- and boarding ships.
Thanks for the idea, but this didn't work.
Somehow I need to manipulate the unit_type file... I think.
Somehow I need to manipulate the unit_type file... I think.
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
Re: Recruit Variation Macro -- and boarding ships.
If I'm not mistaken, the macro you used only works for variations of a unit type, not for modifying the whole type. So, either you have to set up all your types as variations, or go a slightly more complicated way (if there isn't also a macro for that) using a
recruit
event and [modify_unit]
to randomly modify its type.UMC Story Images — Story images for your campaign!
Re: Recruit Variation Macro -- and boarding ships.
I'm pretty sure you're right on that... but it does say in the wiki that it should work for anything, so I gave it a shot.Crendgrim wrote:If I'm not mistaken, the macro you used only works for variations of a unit type...
I didn't find a macro listed, but [modify_unit] seems to be the best, easiest, solution... how would I set up the random factor?..you have to set up all your types as variations, or go a slightly more complicated way (if there isn't also a macro for that) using arecruit
event and[modify_unit]
to randomly modify its type.
I want 80% Reserve Archer, 16% Reserve Bowman, and 4% Reserve Master Bowman, do I use (none,none,Reserve Bowman)?
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
Re: Recruit Variation Macro -- and boarding ships.
While trying to figure out how to make boarding parties work (capture ships) with the plague I decided to change the ships to human...
This worked great! Not only do my ships have names now (allowing events), but they have traits as well. Which gives some variety and makes different ships more valuable for certain tasks. It also means that the ship is now vulnerable to the "plague" boarding party, and can be transformed. Except that it switches to a Walking Corpse, and now I have zombies floating around in the Atlantic.
I thought I managed to get around this, but I obviously put type=Prize Frigate in the wrong place. This is from the unit_type file, should this be in the victims file?
Once this works properly how do I get it to account for the different class ships... a Sloop or Trade Junk shouldn't respawn as a Prize Frigate.
On a side note. I was looking at the race files and a lot of them are using macros... What files do I need to edit to create new races?
This worked great! Not only do my ships have names now (allowing events), but they have traits as well. Which gives some variety and makes different ships more valuable for certain tasks. It also means that the ship is now vulnerable to the "plague" boarding party, and can be transformed. Except that it switches to a Walking Corpse, and now I have zombies floating around in the Atlantic.
I thought I managed to get around this, but I obviously put type=Prize Frigate in the wrong place. This is from the unit_type file, should this be in the victims file?
Code: Select all
[attack]
name=short sword
description=_"Boarding Party"
icon=attacks/sword-human-short.png
type=blade
range=melee
damage=21
number=1
[specials]
{WEAPON_SPECIAL_PLAGUE}
type=Prize Frigate ### <---------- Misplaced?
[/specials]
[/attack]
On a side note. I was looking at the race files and a lot of them are using macros... What files do I need to edit to create new races?
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
Re: Recruit Variation Macro -- and boarding ships.
It propably should look that:
About the races: look at races.cfg in /core, and make a similar file, with custom races made by You.
Code: Select all
[attack]
name=short sword
description=_"Boarding Party"
icon=attacks/sword-human-short.png
type=blade
range=melee
damage=21
number=1
[specials]
{WEAPON_SPECIAL_PLAGUE_TYPE Prize Frigate}
[/specials]
[/attack]
Re: Recruit Variation Macro -- and boarding ships.
...with the difference that WEAPON_SPECIAL_PLAGUE_TYPE takes one argument, not two.Piko555 wrote: {WEAPON_SPECIAL_PLAGUE_TYPE Prize Frigate}
Re: Recruit Variation Macro -- and boarding ships.
Yes, it does. What do You suggest for unit types with a space in their id?
Re: Recruit Variation Macro -- and boarding ships.
Put parantheses or quotes around it.
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Question about boarding ships, gold, storing units, & traits
I have the plague working, as long as I change the ships to human... but I have another situation crop up. When the ships kill a ground unit, the ground unit spawns as a Prize Ship. Maybe not a problem but the AI sees a unit with 0% defense and will always use a unit that would otherwise attack a threat to go after it.
Is there a way to make certain units immune, or better yet make only units with the movement_type:float affected. (Can you filter move_type?) The other alternative is to make the attack only valid against other ships...
--------
I have figured out how to add and reset gold, but not how to deduct 5 gold from a side during an event. This gets me a skip over during the event and the rest of the event does nothing.
----------
I am trying to create amphibious assault units. To do this I need to store and unstore in the same event, but have never tried storing and am screwing up royally somewhere. I have this working now without storing but when you "repack" the unit and then "unpack" again you get completely new units (new name,traits) and I would like to be able to save unit experience and traits.
--------
I would like to give all my warships the healthy trait, but with ships averaging around 90hp repairing 2hp a turn seems too small. Is there a way to give 'heal' to a unit and only have it effect itself? Or bump healthy up?
Is there a way to make certain units immune, or better yet make only units with the movement_type:float affected. (Can you filter move_type?) The other alternative is to make the attack only valid against other ships...
--------
I have figured out how to add and reset gold, but not how to deduct 5 gold from a side during an event. This gets me a skip over during the event and the rest of the event does nothing.
Code: Select all
[gold]
side=1
amount=-50
[/gold
I am trying to create amphibious assault units. To do this I need to store and unstore in the same event, but have never tried storing and am screwing up royally somewhere. I have this working now without storing but when you "repack" the unit and then "unpack" again you get completely new units (new name,traits) and I would like to be able to save unit experience and traits.
Spoiler:
I would like to give all my warships the healthy trait, but with ships averaging around 90hp repairing 2hp a turn seems too small. Is there a way to give 'heal' to a unit and only have it effect itself? Or bump healthy up?
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
Re: Question about boarding ships, gold, storing units, & tr
I think that should work, assuming you didn’t actually forget the last bracket. Please post the surrounding event.junoslord wrote:Code: Select all
[gold] side=1 amount=-50 [/gold
I think you mean this:junoslord wrote:I am trying to create amphibious assault units.
Code: Select all
[event]
name=moveto
first_time_only=no
[filter]
side=1
type=Marine Archer,Marine Bowman,Marine Master Bowman
[filter_location]
terrain=Wwrt
[/filter_location]
[/filter]
[store_unit]
[filter]
id=$unit.id
[/filter]
variable=storedAmphibian
[/store_unit]
[set_variable]
name=storedAmphibian.type
value="Artillery Barge"
[/set_variable]
[unstore_unit]
variable=storedAmphibian
[/unstore_unit]
[/event]
Code: Select all
## Hitpoints are the full maximum of an Artillery Barge and status is cleared.
[modify_unit]
[filter]
id=$unit.id
[/filter]
type="Artillery Barge"
[/modify_unit]
Code: Select all
## Hitpoints and other status is unchanged.
[transform_unit]
id=$unit.id
transform_to="Artillery Barge"
[/transform_unit]
Regenerates?junoslord wrote:I would like to give all my warships the healthy trait, but with ships averaging around 90hp repairing 2hp a turn seems too small. Is there a way to give 'heal' to a unit and only have it effect itself? Or bump healthy up?
[modify_unit] & keeping and adding traits
gold= missing bracket...
regenerate: Thought about that, but it's like the portage-- 2 is too cold, 8 is too hot, but 4 seems just right. In the end I might go with a bit of both, depending on the ship size.
[modify_unit] I used the modify unit option and it worked. So, thank you for the help on that.
But it has one problem... When I recruit and send the Barge off to land everything is fine. The Marine goes ashore, clears the island and moves to reboard the barge. But the problem is: if the unit already leveled up when it gets off the ship again it will be a archer (lvl1) again. (I hope that makes sense.)
There is a solution though: I need to make 4 Artillery Barges, 1 for recruiting, and 1 each for each level of archer unit. Then I need to do this for all the other Marine unit lines (5 lines/14 units total, plus 2 support lines/5 units-- as well as, theoretically, the entire National Army line). Then in the scenario I need to create a base landing, an embarkation, and a second landing event for each individual unit... That's 57 events!
It'll work but it'll be huge! Any idea on the second landing how to get around this and make sure each unit_type is what's it's supposed to be?
--------
Also, if my units and my ships are both human... so they draw from the same pool of traits... If I set the barge num_traits=0 will this erase the traits of the units inside them? This is in the wiki where it talks about keeping unit lines of the same race or you will loose traits for units.
To the same point... If I add a fixed trait to a unit {fearless} in this case to a second level unit in a line and change num_traits=3, will this add the fearless trait and keep the two existing traits intact?
regenerate: Thought about that, but it's like the portage-- 2 is too cold, 8 is too hot, but 4 seems just right. In the end I might go with a bit of both, depending on the ship size.
[modify_unit] I used the modify unit option and it worked. So, thank you for the help on that.
But it has one problem... When I recruit and send the Barge off to land everything is fine. The Marine goes ashore, clears the island and moves to reboard the barge. But the problem is: if the unit already leveled up when it gets off the ship again it will be a archer (lvl1) again. (I hope that makes sense.)
There is a solution though: I need to make 4 Artillery Barges, 1 for recruiting, and 1 each for each level of archer unit. Then I need to do this for all the other Marine unit lines (5 lines/14 units total, plus 2 support lines/5 units-- as well as, theoretically, the entire National Army line). Then in the scenario I need to create a base landing, an embarkation, and a second landing event for each individual unit... That's 57 events!
It'll work but it'll be huge! Any idea on the second landing how to get around this and make sure each unit_type is what's it's supposed to be?
--------
Also, if my units and my ships are both human... so they draw from the same pool of traits... If I set the barge num_traits=0 will this erase the traits of the units inside them? This is in the wiki where it talks about keeping unit lines of the same race or you will loose traits for units.
To the same point... If I add a fixed trait to a unit {fearless} in this case to a second level unit in a line and change num_traits=3, will this add the fearless trait and keep the two existing traits intact?
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
Re: [modify_unit] & keeping and adding traits
Many add-ons have a regenerates +4 ability you could copy. And what’s this about portage? In the context of “too cold, too hot, just right” I’d assume you mean “porridge”, but in the wider context of boats, “portage” could work too.junoslord wrote:regenerate: Thought about that, but it's like the portage-- 2 is too cold, 8 is too hot, but 4 seems just right.
Perhaps each unit’s former type could be stored in itsjunoslord wrote:But it has one problem...
[variables]
?{ABILITY_REPAIR}
So this should be easy, right...
I found the ability file in the core/macro folder and copied the regenerates ability to create a new one called repair. Below is the second version. In the first version I left [regenerate] because I thought I would try to 'mirror' it by leaving the bracket and id= the same, I also tried 5% instead of a value.
For the third try I changed everything to repair and used a numeric value.
The last thing I tried was replacing the value= with this from a trait macro before realizing it would increase hp not repair.
Point is I get 'macro/file "Special_Note_Repair" is missing in unit_type file' errors whatever I try to do.
If I remove the "S_N_R" tag from the [unit_type] file and add {ABILITY_REPAIR} to either the [unit_type] or [unit] it runs the scenario without error, but doesn't show 'repair' as an ability. And the last time it didn't increase the hp of the unit I manually assigned it to in the [unit_type] file.
What am I doing wrong? Everything is in the core folder, with the others.
I thought I would ask before repeating this as an attempt to make a trait... But this almost does what I want it to do, and I thought I'd try to get it to work first.
I found the ability file in the core/macro folder and copied the regenerates ability to create a new one called repair. Below is the second version. In the first version I left [regenerate] because I thought I would try to 'mirror' it by leaving the bracket and id= the same, I also tried 5% instead of a value.
Spoiler:
Spoiler:
Code: Select all
[effect]
apply_to=hitpoints
increase_total=5%
[/effect]
If I remove the "S_N_R" tag from the [unit_type] file and add {ABILITY_REPAIR} to either the [unit_type] or [unit] it runs the scenario without error, but doesn't show 'repair' as an ability. And the last time it didn't increase the hp of the unit I manually assigned it to in the [unit_type] file.
What am I doing wrong? Everything is in the core folder, with the others.
I thought I would ask before repeating this as an attempt to make a trait... But this almost does what I want it to do, and I thought I'd try to get it to work first.
America-- Land of the Free, home of the Brave! "And now that we've taken care of the Braves we're coming after the Free."
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"
"BANNED!!! What the hell do you mean BANNED? All I did was call one narrow-minded, power-hungry Nazi moderator a narrow-minded, power-hungry Nazi!"