Deleted800173User Posted September 14, 2013 Share Posted September 14, 2013 (edited) SOLVED!I have a script that creates leveled enemies and stores them in an array. However when I recall them from the array they return as "none". I can't figure out why this is. I've checked the values immediately after storing them and they return "none" at that point in time. I've also tested these values before they enter the array and they do not return as "none". Does anyone have any advice or information that might help me get these values to stay? Here is my script: setenemies(highestSpawned - 1, spawnPoints[spawnChoice].placeActorAtMe(enemyTypes[enemyChoice], 4, enchZone)) debug.notification("spawn level. is NONE: " + (enemies(highestSpawned - 1) == None)) Here is the getter and setter functions used: ;GETTERS AND SETTERS Actor function enemies(int n) return enemies[n] endFunction function setEnemies(int n, Actor ref) enemies[n] = ref debug.notification("enemies function: is NONE: " + (enemies(n) == none)) debug.notification("enemies array: is NONE: " + (enemies[n] == none)) endFunction All three of these debug messages return with "True" attached to them.Earlier I tested the "ref" value in the setter function above and it returned as "false" meaning that the value was not "none" before it was put into the array. Edited September 15, 2013 by Guest Link to comment Share on other sites More sharing options...
Deleted800173User Posted September 14, 2013 Author Share Posted September 14, 2013 Bump Link to comment Share on other sites More sharing options...
Deleted800173User Posted September 15, 2013 Author Share Posted September 15, 2013 bumping again because this is important to me Link to comment Share on other sites More sharing options...
Deleted800173User Posted September 15, 2013 Author Share Posted September 15, 2013 (edited) new update! I changed the array to be of the objectreference type and re wrote the getter to be: ;GETTERS AND SETTERS Actor function enemies(int n) return enemies[n] as Actor endFunction the value in the array is no longer none but when it is casted as an actor it becomes none!? what's up with actor type variables? Not sure how to get the values to stop becoming none EDIT: new new update! I found a work around solution. Edited September 15, 2013 by Guest Link to comment Share on other sites More sharing options...
ColonolNutty Posted January 7, 2017 Share Posted January 7, 2017 Which was? Come on, don't hold a carrot out and not let us bite. Seriously Link to comment Share on other sites More sharing options...
Deleted800173User Posted January 7, 2017 Author Share Posted January 7, 2017 Which was? Come on, don't hold a carrot out and not let us bite. SeriouslyWow this is a pretty old post.I can't remember what I did. I think I made a giant switch statement using 100 individual actor variables. It sounds ludicrous I know, but apparently Papyrus doesn't like storing actors in arrays so I basically made an array function using a switch statement Link to comment Share on other sites More sharing options...
Recommended Posts