![]() |
Object NOT Loading Vars >_>
First off here's the part of the function in the class:
PHP Code:
The problem is, the "file" object is not returning any of the vars it's loading. >_> What the hell is going on here. |
You sure like to butcher the scripts I give you. Anyhow, make sure npcserver has rights to the folder. Also, you need to declare your temp variables are the beginning of the script X_X
|
Quote:
Edit: Npc server already had rights to the necessary folders and declaring the vars temp prior to fixed nothing. :[ Super Edit: Problem was identified in another class. |
The 'True' Problem
PHP Code:
Here's the issue, the data line. When echoing "data" or "data[0]" it returns the entire array where as "data[1] - data[3]" return zero when they shouldn't. >_> Edit: Didn't Inverness have this same issue with copying arrays? -.- |
You seem to be quite good at editing my scripts and breaking them in the process =P
|
Quote:
|
Quote:
|
Ugh, none of that is the problem. The problem is when I'm trying to put the vars in the array. It creates a multidemensional array rather than fill it up.
EXAMPLE: array 2 = {"crap", "foo", "bar",} array1.clear(); array1 = array2; It's returning array 1 like in on of these: array1 = {array2, array2, array2} And has array two set as all the indices. or Just sets array2 as the first index. But the idea is for: array 1 = array 2 array1 should end up equalling {"crap", "foo", "bar"} |
Ah, I remember a buddy of mine had this problem he had to put something infront of array2
array1 = something(array2); Sorry don't remember what, hope that helps any. :/ |
Maybe it isn't saving right? If you are using add(), try doing addarray() instead (like if you were using it in the file saving). Does the file you are loading from have quotes in the variables?
|
Stop using clear(), its unnecessary
And show me the file you're loading from. |
Assigning one array to another is working fine.
When you only get stuff in data[0] or data then it is probably not an array, eventually the item data is not a correct comma-separated list (manually edited?). It must be text,"item name",text instead of text,item name,text |
Quote:
varname="text,text,text" It will give you (in GS2 terms): varname = {{"text", "text", "text"}}; As you can see that is an array inside an array so what you want is: varname=text,text,text |
Zero and Stefan perfectly fixed my problems. :D Thanks guys for all your help. Inside the file the var wasn't an array, it was a string. >_> :D
|
No problem :)
|
| All times are GMT +2. The time now is 11:02 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.