unstore_unit and variable problem in 1.14
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.
unstore_unit and variable problem in 1.14
Hi I've started what looks like a pretty big job getting my mods to work in 1.14 after what looks like a lot of changes to WML recently, at the moment I'm struggling to work out why variables are causing an error:
The code causing this is:
Invalid WML found> [unstore_unit]: variable 'tempstore' doesn't contain unit data
I'm guessing the why the variable is declared must have changed, but can't seem find this in the WML documentation -The code causing this is:
Code: Select all
[store_unit]
[filter]
x=$unitplacement[$random].x
y=$unitplacement[$random].y
[/filter]
kill=yes
variable=tempstore
[/store_unit]
{VARIABLE tempstore.moves 1}
{VARIABLE tempstore.alignment neutral}
{VARIABLE tempstore.max_experience 1000}
{VARIABLE tempstore.attacks_left 0}
[unstore_unit]
variable=tempstore
[/unstore_unit]
{CLEAR_VARIABLE tempstore}
#enddef
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Re: unstore_unit and variable problem in 1.14
Before it was silently failing, now shows message. You should either consider why there is no unit, or unstore unit only if unit exists.
Re: unstore_unit and variable problem in 1.14
Hm thanks Ravana maybe unstore_unit here is not needed I'll just see how it goes removing that where it causes the error...
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
AI/ non-player Factions displaying in game creation
Hi I have another issue, not sure if this is another 1.14 issue, when I start a game which has non-player side/AI, I can actually see this as a playable side in game creation, does anyone know how to make the AI side so it's trully non-playable? I believe I have done this already with allow_player=no bit it still lets me choose the AI side to play....
Code: Select all
[side]
side=7
no_leader=yes
team_name=neutral
user_team_name= _ "neutral"
canrecruit=no
controller=AI
allow_player=no
fog=no
[ai]
aggression=0.0
caution=1.0
ai_algorithm=default
village_value=10.0
[/ai]
team_lock=true
color_lock=true
gold_lock=true
income_lock=true
faction_lock=true
leader_lock=true
[/side]
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Re: unstore_unit and variable problem in 1.14
Make sure that you have use map settings checked.
Other issues - true -> yes and AI -> ai.
Other issues - true -> yes and AI -> ai.
- Pentarctagon
- Project Manager
- Posts: 5531
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: unstore_unit and variable problem in 1.14
Moved to the WML Workshop.
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: unstore_unit and variable problem in 1.14
You can set force_lock_settings=yes inside the [multiplayer] tag, which forces the use of map settings. However, it also sets all the xxx_lock atributes to yes, you may want to set some of the to no for the player.
Other changes:
no_leader=yes — not needed anymore, if you have leader_lock=yes, Same for all the other values which would be used to create a leader, such as canrecruit.
allow_observes=no — I set this usually for AI sides. Less to not spoil observers, but more to not show all the moves.
ai_algorithm=default — you don't need to set this manually. But you can try the new experimental_ai.
Other changes:
no_leader=yes — not needed anymore, if you have leader_lock=yes, Same for all the other values which would be used to create a leader, such as canrecruit.
allow_observes=no — I set this usually for AI sides. Less to not spoil observers, but more to not show all the moves.
ai_algorithm=default — you don't need to set this manually. But you can try the new experimental_ai.
Try out the dark board theme.
Re: unstore_unit and variable problem in 1.14
Thanks I'll try some of these ideas...
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Re disabling AI for players in startup
I managed to hide both the AI as a player option and also the AI pulldown to change the algorithm as follows, I think 'null' should be OK as my AI isn't supposed to move or recruit just sit on vilas and hit back when attacked, this might additionally address a rare bug when AI moves even when movement is set to 0...
Code: Select all
[side]
side=7
controller=null
controller_lock=true
no_leader=yes
team_name=neutral
user_team_name= _ "neutral"
canrecruit=no
allow_player=false
fog=no
team_lock=true
color_lock=true
gold_lock=true
income_lock=true
faction_lock=true
leader_lock=true
[ai]
aggression=0.0
caution=1.0
ai_algorithm=default
village_value=10.0
[/ai]
[/side]
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)