#yet another list issue

1 messages · Page 1 of 1 (latest)

cobalt roost
#

am i stupid, why doesn't my list have any values again

on pick up:
    set {_item} to namespacedkey of event-item
    set {_worth} to {-loot::drop_value_map::%{_item}%::worth}
    set {_currency} to {-loot::drop_value_map::%{_item}%::currency}
    
    broadcast {-loot::drop_value_map::%{_item}%::currency} # displays properly
    
    stop if {_currency} is not set
    
    add {_worth} to {stats::%uuid of player%::%{_currency}%}
    
    play sound "entity.experience_orb.pickup" with volume 0.5 and pitch 2 at event-location for all players
    
    updateActionBar(player, {_worth}, {_currency})
    updateScoreboard(player)
    
    broadcast {-loot::virtual_drops::*} # doesn't display in chat
    
    stop if {-loot::virtual_drops::*} does not contain event-item # nothing happens at all below this line
    
    wait 1 tick
    remove event-item from player
#

here are the functions responsible for registering items and marking virtual

function lt_registerDrop(table: string, drop: item, weight: integer, set_virtual: boolean, is_unique: boolean = false):
    add {_weight} to {-loot::%{_table}%::weights::*}
    
    add {_drop} to {-loot::%{_table}%::drops::*}
    add {_drop} to {-loot::%{_table}%::unique_drops::*} if {_is_unique} is true
    add {_drop} to {-loot::global_drops::*} if {-loot::global_drops::*} does not contain {_drop}
    
     lt_setVirtual({_drop}) if {_set_virtual} is true
     
function lt_setVirtual(drop: item):
    add {_drop} to {-loot::virtual_drops::*} if {-loot::virtual_drops::*} does not contain {_drop}
#

and here is where items are registered

on load:
    clear {-loot::*}
    
    # redundant drops ommitted for clarity
    lt_registerDrop("small_pot", gold_nugget, 22, true)
    lt_registerDrop("large_pot", gold_nugget, 180, true)
    lt_registerDrop("zombie", gold_nugget, 28, true)
    lt_registerDrop("skeleton", gold_nugget, 28, true)
    
    lt_setDropRange("small_pot", 1, 3)
    lt_setDropRange("large_pot", 5, 9)
    lt_setDropRange("zombie", 3, 7)
    lt_setDropRange("skeleton", 3, 7)
    
    lt_setVirtualItemWorth("tokens", gold_nugget, 1)
#

but like, when i pick up a gold nugget it doesnt remove it from my inventory

#

clearly my function lt_registerDrop registers the item into the loot tables and marks it virtual but like my virtual items list just doesnt exist at all for some reason

#

my bad for trying to use skript as an actual programming language 💔

craggy steppe
cobalt roost
#

i just fixed it bruh

craggy steppe
#

Great

cobalt roost
#

it doesnt even give me indentation errors in chat

#

i would have caught this if it did

midnight folio
#

it does give indention errors

#

the parser gives them fine