Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This is a method of creating an array of dictionaries all of which are set to default keys and values,
- # which means you can now quickly set up large amounts of data quickly through the inspector
- tool # will not work if you don't/can't make the script a tool
- extends Node # OR WHATEVER
- export(Array,Dictionary) var pool = [] setget set_pooldict
- var pool_size = pool.size()
- func set_pooldict(pooldictarray : Array):
- var n = pooldictarray.size()
- if n > pool_size:
- var pooldict_def = {
- "Predefined String" : "",
- "Predefined Int" : 0,
- "Predefined Float" : 0.0,
- "Predefined Bool" : false
- } #etc; used to have this as a const outside of the function, but this caused weird issues
- pooldictarray[n-1].merge(pooldict_def)
- pool_size = n
- pool = pooldictarray
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement