unstore_unit and variable problem in 1.14

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.
Post Reply
User avatar
Gwledig
Posts: 537
Joined: March 30th, 2009, 5:10 pm
Location: UK

unstore_unit and variable problem in 1.14

Post by Gwledig » July 9th, 2019, 11:10 pm

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:
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)

User avatar
Ravana
Forum Moderator
Posts: 2262
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: unstore_unit and variable problem in 1.14

Post by Ravana » July 9th, 2019, 11:22 pm

Before it was silently failing, now shows message. You should either consider why there is no unit, or unstore unit only if unit exists.

User avatar
Gwledig
Posts: 537
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: unstore_unit and variable problem in 1.14

Post by Gwledig » July 9th, 2019, 11:29 pm

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)

User avatar
Gwledig
Posts: 537
Joined: March 30th, 2009, 5:10 pm
Location: UK

AI/ non-player Factions displaying in game creation

Post by Gwledig » July 10th, 2019, 12:04 am

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)

User avatar
Ravana
Forum Moderator
Posts: 2262
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: unstore_unit and variable problem in 1.14

Post by Ravana » July 10th, 2019, 12:07 am

Make sure that you have use map settings checked.

Other issues - true -> yes and AI -> ai.

User avatar
Pentarctagon
Forum Administrator
Posts: 4098
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: unstore_unit and variable problem in 1.14

Post by Pentarctagon » July 10th, 2019, 12:37 am

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

Shiki
Developer
Posts: 276
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: unstore_unit and variable problem in 1.14

Post by Shiki » July 10th, 2019, 11:10 am

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.
Introduction to WML filtering and WML variables.

User avatar
Gwledig
Posts: 537
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: unstore_unit and variable problem in 1.14

Post by Gwledig » July 10th, 2019, 5:30 pm

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)

User avatar
Gwledig
Posts: 537
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re disabling AI for players in startup

Post by Gwledig » July 12th, 2019, 6:49 pm

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)

Post Reply