Date: 2014/10/28 06:06:51 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
I have this list
- flag npc 'Markets:vacant|vacant|vacant'
I'm looping through it using this to put the player name in the first 'vacant' position in the array.
- define nMarket 0
- foreach <npc.flag[Markets].as_list> {
- define nMarket <math.as_int:%nMarket%+1>
- if %value% == 'vacant' {
- flag npc <npc.flag[Markets].as_list.insert[<player.name>].at[%nMarket%]>
- foreach stop
}
}
Expecting the output in the saves.yml to be this as it should insert the name at position 1 on it's first loop
'1028':
Flags:
MARKETS:
- luigi_vampa|vacant|vacant|vacant
But instead I get this. It's inserting the values of the list as the name of a new flag!
'1028':
Flags:
MARKETS:
- vacant|vacant|vacant
LI@LUIGI_VAMPA|VACANT|VACANT|VACANT:
- 'true'
so I'm guessing the problem is this line but I can't figure it out.
- flag npc <npc.flag[Markets].as_list.insert[<player.name>].at[%nMarket%]>