Necromanteion [0.7.1]
Moderator: Forum Moderators
Re: Necromanteion
Oops, I think I oversaw your last comment and answered only to A Guy's.DEATH_is_undead wrote:No, like I said, if a player selects Undead, have an in game message that lets them select another faction. Easy, simple, and solves the problem.
Yep, something like the thing you propose sounds good enough.
Would be something like a "prestart" (or "start") triggered event, reading the faction the leader belongs to. (Is there such a variable stored? Couldn't find it on a quick search.) If the faction would be Undead, the leader would be killed, a selection window shown to the player and a new leader due to his selection would be created on the starting position... Will take a closer look at this tomorrow.
ThanatoNoth | Necromanteion | Undead Rights Protection Society
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
Re: Necromanteion
Well, you could use the name of the side (the name varies with the faction).
I'm just... a guy...
I'm back for now, I might get started on some work again.
I'm back for now, I might get started on some work again.
Re: Necromanteion
Okay, I outlined some of the needed code. (It's quiet not finished yet.)
What I really can't find is the correct variable. If anyone could give me some hint there.
/edit: I am also not really convinced about the "start" trigger. Seems, some things are still not set then.
What I really can't find is the correct variable. If anyone could give me some hint there.
Code: Select all
# check if sides 1 or 2 is playing undead faction, and if so, replacing faction
#define CHECK_AND_SELECT_FACTION SIDE
[event]
name=start
[if]
[have_unit]
x,y=$startposx,14
canrecruit=yes
[and]
[variable]
name= ???
equals=Undead
[/variable]
[/and]
[/have_unit]
[then]
[kill]
[filter]
x,y=$startposx,14
[/filter]
[/kill]
[message]
side_for={SIDE}
duration=30
speaker=narrator
message= _ "~You are playing the Undead faction. Use of this faction is not allowed in this scenario. Please select a new faction below."
[option]
message= _ "Random faction"
[command]
{CREATE_NEW_LEADER Random x y}
[/command]
[/option]
[option]
message= _ "Drakes"
[command]
{CREATE_NEW_LEADER Drakes x y}
[/command]
[/option]
[option]
message= _ "Knalgans"
[command]
{CREATE_NEW_LEADER Knalgans x y}
[/command]
[/option]
[option]
message= _ "Loyalists"
[command]
{CREATE_NEW_LEADER Loyalists x y}
[/command]
[/option]
[option]
message= _ "Northerners"
[command]
{CREATE_NEW_LEADER Northeners x y}
[/command]
[/option]
[option]
message= _ "Rebels"
[command]
{CREATE_NEW_LEADER Northeners x y}
[/command]
[/option]
[/message]
[/then]
[/if]
[/event]
#enddef
{CHECK_AND_SELECT_FACTION 1}
{CHECK_AND_SELECT_FACTION 2}
ThanatoNoth | Necromanteion | Undead Rights Protection Society
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
- DEATH_is_undead
- Posts: 960
- Joined: March 4th, 2007, 3:00 pm
- Location: Northern United States
Re: Necromanteion
Un-needed, just filter the ID of the leaders, like on Wesbowl, you could even copy the code to see if it is.A Guy wrote:Well, you could use the name of the side (the name varies with the faction).
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
Re: Necromanteion
Worked a bit more on the code, can't sleep somehow.
I know, I do quiet little steps lately, but it IS kindof unusual work for me, so please be patient.
@Death_is_undead:
I searched the Wesbowl.cfg from mainline for a unit id filter. However, it seems that I am blind, because I couldn't find anything that would be a help to determine which faction the unit is from. Finding out the side number is easy... but not the factions name.
/edit: I just found out, that the events name cannot be "turn 1". For some reason "1" isnt' allowed. However: How to trigger then an event that should fire at the begin of turn 1 for each player?
/edit2: Well "start" seems to work. The event does fire, does show the menu as it should an actually kills the unit. Some progress
I know, I do quiet little steps lately, but it IS kindof unusual work for me, so please be patient.
@Death_is_undead:
I searched the Wesbowl.cfg from mainline for a unit id filter. However, it seems that I am blind, because I couldn't find anything that would be a help to determine which faction the unit is from. Finding out the side number is easy... but not the factions name.
/edit: I just found out, that the events name cannot be "turn 1". For some reason "1" isnt' allowed. However: How to trigger then an event that should fire at the begin of turn 1 for each player?
/edit2: Well "start" seems to work. The event does fire, does show the menu as it should an actually kills the unit. Some progress
Code: Select all
#define CHECK_AND_SELECT_FACTION SIDE
[event]
[if]
[variable]
name=side_number
equals=1
[/variable]
[then]
[set_variable]
name=startposx
value=1
[/set_variable]
[/then]
[else]
[set_variable]
name=startposx
value=39
[/set_variable]
[/else]
[/if]
[if]
[have_unit]
x,y=$startposx,14
canrecruit=yes
[and]
[variable]
name= ???
equals=Undead
[/variable]
[/and]
[/have_unit]
[then]
[kill]
[filter]
x,y=$startposx,14
[/filter]
[/kill]
[message]
side_for={SIDE}
duration=30
speaker=narrator
message= _ "~You are playing the Undead faction. Use of this faction is not allowed in this scenario. Please select a new faction below."
[option]
message= _ "Random faction"
[command]
{CREATE_NEW_LEADER Random x y}
[/command]
[/option]
[option]
message= _ "Drakes"
[command]
{CREATE_NEW_LEADER Drakes x y}
[/command]
[/option]
[option]
message= _ "Knalgans"
[command]
{CREATE_NEW_LEADER Knalgans x y}
[/command]
[/option]
[option]
message= _ "Loyalists"
[command]
{CREATE_NEW_LEADER Loyalists x y}
[/command]
[/option]
[option]
message= _ "Northerners"
[command]
{CREATE_NEW_LEADER Northeners x y}
[/command]
[/option]
[option]
message= _ "Rebels"
[command]
{CREATE_NEW_LEADER Northeners x y}
[/command]
[/option]
[/message]
[/then]
[/if]
{CLEAR_VARIABLE startposx}
[/event]
#enddef
{CHECK_AND_SELECT_FACTION 1}
{CHECK_AND_SELECT_FACTION 2}
ThanatoNoth | Necromanteion | Undead Rights Protection Society
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
- DEATH_is_undead
- Posts: 960
- Joined: March 4th, 2007, 3:00 pm
- Location: Northern United States
Re: Necromanteion
Uhhh.... Why go through all of this? Copy and paste the Leaders line in Undead faction, and putThanatos wrote:Worked a bit more on the code, can't sleep somehow.
I know, I do quiet little steps lately, but it IS kindof unusual work for me, so please be patient.
@Death_is_undead:
I searched the Wesbowl.cfg from mainline for a unit id filter. However, it seems that I am blind, because I couldn't find anything that would be a help to determine which faction the unit is from. Finding out the side number is easy... but not the factions name.
/edit: I just found out, that the events name cannot be "turn 1". For some reason "1" isnt' allowed. However: How to trigger then an event that should fire at the begin of turn 1 for each player?
/edit2: Well "start" seems to work. The event does fire, does show the menu as it should an actually kills the unit. Some progress
Code: Select all
#define CHECK_AND_SELECT_FACTION SIDE [event] [if] [variable] name=side_number equals=1 [/variable] [then] [set_variable] name=startposx value=1 [/set_variable] [/then] [else] [set_variable] name=startposx value=39 [/set_variable] [/else] [/if] [if] [have_unit] x,y=$startposx,14 canrecruit=yes [and] [variable] name= ??? equals=Undead [/variable] [/and] [/have_unit] [then] [kill] [filter] x,y=$startposx,14 [/filter] [/kill] [message] side_for={SIDE} duration=30 speaker=narrator message= _ "~You are playing the Undead faction. Use of this faction is not allowed in this scenario. Please select a new faction below." [option] message= _ "Random faction" [command] {CREATE_NEW_LEADER Random x y} [/command] [/option] [option] message= _ "Drakes" [command] {CREATE_NEW_LEADER Drakes x y} [/command] [/option] [option] message= _ "Knalgans" [command] {CREATE_NEW_LEADER Knalgans x y} [/command] [/option] [option] message= _ "Loyalists" [command] {CREATE_NEW_LEADER Loyalists x y} [/command] [/option] [option] message= _ "Northerners" [command] {CREATE_NEW_LEADER Northeners x y} [/command] [/option] [option] message= _ "Rebels" [command] {CREATE_NEW_LEADER Northeners x y} [/command] [/option] [/message] [/then] [/if] {CLEAR_VARIABLE startposx} [/event] #enddef {CHECK_AND_SELECT_FACTION 1} {CHECK_AND_SELECT_FACTION 2}
[filter]
id=the undead leader's line
[/filter]
THEN
[kill]
the undead units
[/kill]
THEN
[if] no leader for a side, then
[message]
speaker=narrator
message="Undeads is not allowed, please pick another faction"
side=
[option]
ect, ect...
[/option]
[/message]
EDIT: Once I get the parts for my new computer, and reinstall windows (hate having a Motherboard die), I'll help with the code. But as of right now, I cannot test any of my code.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
Re: Necromanteion
[option]s in any "turn" events cause OOS.
- DEATH_is_undead
- Posts: 960
- Joined: March 4th, 2007, 3:00 pm
- Location: Northern United States
Re: Necromanteion
That kills our ideas... Stone leaders for one turn, but leave leader one unstoned, then do the message when he moves, then teleport him to his original spot?zookeeper wrote:[option]s in any "turn" events cause OOS.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
Re: Necromanteion
Won't work, because he could have recruited before that. Or he won't move his leader for the first 5 or so turns, 'til his other units have discovered location of and path to the temple.DEATH_is_undead wrote:That kills our ideas... Stone leaders for one turn, but leave leader one unstoned, then do the message when he moves, then teleport him to his original spot?
Or did I misunderstand you?
Well, it seems, I have to ship a modified era with the scenario.
Should be quiet easy to make it. Just write a new era.cfg which includes all the default factions but the Undead.
However, problem will then still be to make the players use the new era.
Can a scenario be crafted to accept predefined eras only?
/edit:
I declare this problem solved, after I saw how very easy it really is to create the needed era:
Code: Select all
[era]
id=thanatos_era_default_no-ud
name= _ "Default (No Undead)"
{RANDOM_SIDE}
{multiplayer/factions/loyalists-default.cfg}
{multiplayer/factions/rebels-default.cfg}
{multiplayer/factions/northerners-default.cfg}
{multiplayer/factions/knalgans-default.cfg}
{multiplayer/factions/drakes-default.cfg}
[/era]
This reminds me of my math teacher, when we tried the most complicated ways to find a solution for a mathematical problem:
My math teacher wrote:Why try the easy way, when there is also a hard one, right?
ThanatoNoth | Necromanteion | Undead Rights Protection Society
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
Re: Necromanteion
New post, last WML task: Finding a random spawn point for the random undead spawns. The code needs to present kind of random coordinates (x,y) of a location that is not occupied by another unit and is a terrain type that this unit can move onto (no spawn on impassable mountains of course).
My first approach above {SELECT_RANDOM_POS} is heavily flawed due to use of recursive programming, which is not supported by WML (even the mere reading of the cfg while starting Wesnoth will make the game crash due to massive computing overload). I intend to use [while] instead. I already found the NEAREST_HEX macro in the WML workshop and will try to get some ideas from it.
My first approach above {SELECT_RANDOM_POS} is heavily flawed due to use of recursive programming, which is not supported by WML (even the mere reading of the cfg while starting Wesnoth will make the game crash due to massive computing overload). I intend to use [while] instead. I already found the NEAREST_HEX macro in the WML workshop and will try to get some ideas from it.
ThanatoNoth | Necromanteion | Undead Rights Protection Society
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
Re: Necromanteion
Use a single [store_locations] to store all the valid spawn locations, and then just pick a random one. Searching for 1..$ in mainline campaigns brings up several such bits of code.
Re: Necromanteion
Something like this?
/edit: slight changes
/edit2: If this works, the only thing missing would be a filter to check if the field is occupied by another unit. Can that be done via "[and][not][have_unit]" ?
/edit3:
The code above makes the game freeze at beginnig of turn 5.
So somethings wrong with the code.
/edit4: Code updated to last tested version. Still freezes, if after turn 4 the temple hex is unoccupied.
/edit5: I am so stupid. Forgot to count "$loops" up in the [while]. So it doesn't freeze anymore. But also no units spawn.
/edit6: Changed the wrong definition of terrain types to Gg, and Ggf (which is used mainly now in the testing map). Still, no Spawns.
/edit7: added the [filter_location] tags. Still no spawns.
/edit8: Last one for today. The code still doesn't work, I will take another look later.
Code: Select all
# spawn undead if no leader occupies the temple hex
#define SELECT_RANDOM_UNDEAD
[set_variable]
name=rand_ud
rand="Ghost","Ghoul","Skeleton","Skeleton Archer","Walking Corpse"
[/set_variable]
#enddef
#define SPAWN_RANDOM_UNDEAD TIMES
[set_variable]
name=loops
value=0
[/set_variable]
[while]
[variable]
name=loops
less_than_equal_to={TIMES}
[/variable]
[do]
{SELECT_RANDOM_UNDEAD}
[store_location]
[filter]
[filter_location]
x,y=15,9-25,19
[and]
terrain=Gg,Ggf
[/and]
[/filter_location]
[/filter]
variable=spawnhex
[/store_location]
[set_variable]
name=maxlength
format=$spawnhex.length
[/set_variable]
[set_variable]
name=maxlength
add=-1
[/set_variable]
[set_variable]
name=rand_container
rand=1..$maxlength
[/set_variable]
[set_variable]
name=rand_posx
format=$spawnhex[$rand_container].x
[/set_variable]
[set_variable]
name=rand_posy
format=$spawnhex[$rand_container].y
[/set_variable]
{GENERIC_UNIT 3 $rand_ud $rand_posx $rand_posy}
[set_variable]
name=loops
add=1
[/set_variable]
[/do]
[/while]
{CLEAR_VARIABLE loops}
{CLEAR_VARIABLE rand_container}
{CLEAR_VARIABLE spawnhex}
{CLEAR_VARIABLE maxlength}
#enddef
[event]
name=turn 5
[event]
name=new turn
first_time_only=no
[if]
[not]
[have_unit]
x,y=20,14
[and]
canrecruit=yes
[/and]
[/have_unit]
[/not]
[then]
{SPAWN_RANDOM_UNDEAD 3}
{CLEAR_VARIABLE rand_ud}
{CLEAR_VARIABLE rand_posx}
{CLEAR_VARIABLE rand_posy}
[/then]
[/if]
[/event]
[/event]
/edit2: If this works, the only thing missing would be a filter to check if the field is occupied by another unit. Can that be done via "[and][not][have_unit]" ?
/edit3:
The code above makes the game freeze at beginnig of turn 5.
So somethings wrong with the code.
/edit4: Code updated to last tested version. Still freezes, if after turn 4 the temple hex is unoccupied.
/edit5: I am so stupid. Forgot to count "$loops" up in the [while]. So it doesn't freeze anymore. But also no units spawn.
/edit6: Changed the wrong definition of terrain types to Gg, and Ggf (which is used mainly now in the testing map). Still, no Spawns.
/edit7: added the [filter_location] tags. Still no spawns.
/edit8: Last one for today. The code still doesn't work, I will take another look later.
ThanatoNoth | Necromanteion | Undead Rights Protection Society
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
- DEATH_is_undead
- Posts: 960
- Joined: March 4th, 2007, 3:00 pm
- Location: Northern United States
Re: Necromanteion
Ok, why not kill the undead leader, and then make the sides gold EQUAL 100 (or whatever gold is suppost to be) then kill units. OR you could [terrain_mask]/[terrain] the keeps in on turn 2, and stone leaders turn one?Thanatos wrote:Something like this?
/edit: slight changesCode: Select all
# spawn undead if no leader occupies the temple hex #define SELECT_RANDOM_UNDEAD [set_variable] name=rand_ud rand="Ghost","Ghoul","Skeleton","Skeleton Archer","Walking Corpse" [/set_variable] #enddef #define SPAWN_RANDOM_UNDEAD TIMES [set_variable] name=loops value=0 [/set_variable] [while] [variable] name=loops less_than_equal_to={TIMES} [/variable] [do] {SELECT_RANDOM_UNDEAD} [store_location] [filter] [filter_location] x,y=15,9-25,19 [and] terrain=Gg,Ggf [/and] [/filter_location] [/filter] variable=spawnhex [/store_location] [set_variable] name=maxlength format=$spawnhex.length [/set_variable] [set_variable] name=maxlength add=-1 [/set_variable] [set_variable] name=rand_container rand=1..$maxlength [/set_variable] [set_variable] name=rand_posx format=$spawnhex[$rand_container].x [/set_variable] [set_variable] name=rand_posy format=$spawnhex[$rand_container].y [/set_variable] {GENERIC_UNIT 3 $rand_ud $rand_posx $rand_posy} [set_variable] name=loops add=1 [/set_variable] [/do] [/while] {CLEAR_VARIABLE loops} {CLEAR_VARIABLE rand_container} {CLEAR_VARIABLE spawnhex} {CLEAR_VARIABLE maxlength} #enddef [event] name=turn 5 [event] name=new turn first_time_only=no [if] [not] [have_unit] x,y=20,14 [and] canrecruit=yes [/and] [/have_unit] [/not] [then] {SPAWN_RANDOM_UNDEAD 3} {CLEAR_VARIABLE rand_ud} {CLEAR_VARIABLE rand_posx} {CLEAR_VARIABLE rand_posy} [/then] [/if] [/event] [/event]
/edit2: If this works, the only thing missing would be a filter to check if the field is occupied by another unit. Can that be done via "[and][not][have_unit]" ?
/edit3:
The code above makes the game freeze at beginnig of turn 5.
So somethings wrong with the code.
/edit4: Code updated to last tested version. Still freezes, if after turn 4 the temple hex is unoccupied.
/edit5: I am so stupid. Forgot to count "$loops" up in the [while]. So it doesn't freeze anymore. But also no units spawn.
/edit6: Changed the wrong definition of terrain types to Gg, and Ggf (which is used mainly now in the testing map). Still, no Spawns.
/edit7: added the [filter_location] tags. Still no spawns.
/edit8: Last one for today. The code still doesn't work, I will take another look later.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
Re: Necromanteion
I appreciate your enthusiasm in still working on this. However, as said above I don't see why I should go through all that stuff just for my scenario. Of course it would be neat to have a macro maybe that would help to control faction usage, but as it seems this is not yet easy to implement. Maybe a hint for the WML developers?DEATH_is_undead wrote:Ok, why not kill the undead leader, and then make the sides gold EQUAL 100 (or whatever gold is suppost to be) then kill units. OR you could [terrain_mask]/[terrain] the keeps in on turn 2, and stone leaders turn one?
About the SPAWN_RANDOM_UNDEAD code:
I found another glitch and changed [store_location] into [store_locations]. But still: No spawns.
I'll be thankful if anyone more experienced would go over that piece of code I attach here to search for structural problems. As far as I can see the major idea of the code should be working. I don't get any error messages, no crashes, no freezes, so it is no major WML abuse.
I gues I still am not storing locations correctly (still the check for occupation is not implemented), or I am not handling the array right. Please tell me, if anyone has a hint.
Code: Select all
# spawn undead if no leader occupies the temple hex
#define SELECT_RANDOM_UNDEAD
[set_variable]
name=rand_ud
rand="Ghost","Ghoul","Skeleton","Skeleton Archer","Walking Corpse"
[/set_variable]
#enddef
#define SPAWN_RANDOM_UNDEAD TIMES
[set_variable]
name=loops
value=0
[/set_variable]
[while]
[variable]
name=loops
less_than_equal_to={TIMES}
[/variable]
[do]
{SELECT_RANDOM_UNDEAD}
[store_locations]
[filter]
[filter_location]
x,y=15,9-25,19
[and]
terrain=Gg,Ggf
[/and]
[/filter_location]
[/filter]
variable=spawnhex
[/store_locations]
[set_variable]
name=maxlength
format=$spawnhex.length
[/set_variable]
[set_variable]
name=maxlength
add=-1
[/set_variable]
[set_variable]
name=rand_container
rand=1..$maxlength
[/set_variable]
[set_variable]
name=rand_posx
format=$spawnhex[$rand_container].x
[/set_variable]
[set_variable]
name=rand_posy
format=$spawnhex[$rand_container].y
[/set_variable]
{GENERIC_UNIT 3 $rand_ud $rand_posx $rand_posy}
[set_variable]
name=loops
add=1
[/set_variable]
[/do]
[/while]
{CLEAR_VARIABLE loops}
{CLEAR_VARIABLE rand_container}
{CLEAR_VARIABLE spawnhex}
{CLEAR_VARIABLE maxlength}
#enddef
[event]
name=turn 5
[event]
name=new turn
first_time_only=no
[if]
[not]
[have_unit]
x,y=20,14
[and]
canrecruit=yes
[/and]
[/have_unit]
[/not]
[then]
{SPAWN_RANDOM_UNDEAD 3}
{CLEAR_VARIABLE rand_ud}
{CLEAR_VARIABLE rand_posx}
{CLEAR_VARIABLE rand_posy}
[/then]
[/if]
[/event]
[/event]
ThanatoNoth | Necromanteion | Undead Rights Protection Society
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
"The gods can demand nothing of me. Even gods answer to me, eventually. [...] I cannot be bidden, I cannot be forced. I will do only that which I know to be right." (Death in Pratchett's "Mort")
Re: Necromanteion
[store_locations] takes a standard location filter, not a standard location filter inside a [filter] and/or [filter_location] tags. Just like a moveto/attack/whatever event doesn't take a standard unit filter, it takes a standard unit filter inside a [filter] and/or [filter_second] tags.
And it's indeed [store_locations], not [store_location].
And it's indeed [store_locations], not [store_location].