How do i spawn units around certain terrain every turn
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.
How do i spawn units around certain terrain every turn
Hi everyone, this is my first post in the forum and english is not my native language so i'm sorry if i'm asking my question in the wrong place or making any grammar mistake.
How do i spawn a certain unit around certain terrain every turn for certain side (myself,my ally or enemy).
I'm playing 4p_A_New_Land scenario and i'm maked my own little change so when enemies capture my human-city(^Vhc) terrain will change to human-city-ruin(^Vhcr).
I want few Walking Corpse spawn around human-city-ruin(^Vhcr) wich is now under enemys control every turn.
Human citys spawn zombies......its a zombie apocalypse scenario.
I will be very grateful if someone send me the code or point me to the helpful topic.
Thanks.
How do i spawn a certain unit around certain terrain every turn for certain side (myself,my ally or enemy).
I'm playing 4p_A_New_Land scenario and i'm maked my own little change so when enemies capture my human-city(^Vhc) terrain will change to human-city-ruin(^Vhcr).
I want few Walking Corpse spawn around human-city-ruin(^Vhcr) wich is now under enemys control every turn.
Human citys spawn zombies......its a zombie apocalypse scenario.
I will be very grateful if someone send me the code or point me to the helpful topic.
Thanks.
Re: How do i spawn units around certain terrain every turn
Start by creating one zombie every turn in specific location. Once that is working adjust it to affect all Vhcr.
https://wiki.wesnoth.org/EventWML#new_turn
https://wiki.wesnoth.org/SingleUnitWML
https://wiki.wesnoth.org/InternalAction ... cations.5D
https://wiki.wesnoth.org/ConditionalAct ... foreach.5D
https://wiki.wesnoth.org/EventWML#new_turn
https://wiki.wesnoth.org/SingleUnitWML
https://wiki.wesnoth.org/InternalAction ... cations.5D
https://wiki.wesnoth.org/ConditionalAct ... foreach.5D
Re: How do i spawn units around certain terrain every turn
Thanks Ravana for the guidance and links, right now i can create one zombie in specific location every turn by using this code:Ravana wrote: ↑April 14th, 2023, 9:11 pm Start by creating one zombie every turn in specific location. Once that is working adjust it to affect all Vhcr.
https://wiki.wesnoth.org/EventWML#new_turn
https://wiki.wesnoth.org/SingleUnitWML
https://wiki.wesnoth.org/InternalAction ... cations.5D
https://wiki.wesnoth.org/ConditionalAct ... foreach.5D
Code: Select all
[set_variable]
name=Corpse
rand=defpl_Corpse_Walking
[/set_variable]
[unit]
x,y={X},{Y}
generate_name=yes
random_traits=yes
type=$Corpse
side=5
[/unit]
[if]
[variable]
name=Corpse
equals=defpl_Corpse_Walking
[/variable]
[then]
[unit]
terrain={X},{Y}
type=defpl_Corpse_Walking
side=8
[/unit]
[/then]
[/if]
[clear_variable]
name=typeofenemy
[/clear_variable]
#enddef
[event]
name=new turn
first_time_only=no
{CORPSE 32 27}
[/event]
Last edited by Ravana on April 15th, 2023, 8:41 am, edited 1 time in total.
Reason: [code][/code]
Reason: [code][/code]
Re: How do i spawn units around certain terrain every turn
https://wiki.wesnoth.org/StandardLocati ... g_Terrains example 2 shows how to filter for terrain by overlay.