failure passing var to spawn2 or PEBCAK?
PLEASE let the answer be PEBCAK.
Ok so I have a script that spawn an npc based on a variable for the spawn ID This causes a zone.exe crash everytime When tested, @row[0] = 2700972 that value is the npc_id for that particular case, that I want to spawn.. Without posting all of my plugins and such... lets pretend that (It does some work and produces a @ array, after searching the DB for some parameters using a db plugin) This crashes zone.exe Code:
my $var_to_test = @row[0] Code:
quest::spawn2(@row[0],0,0,$x,$y,$z,$h); this does NOT crash zone.exe, and it works and spawns the npc - but is useless to me because i am hardcoding it in that case. Code:
my $var_to_test = 2700972; i tried my ($var_to_test) = @row; which supposedly takes the first value from row, but that didn't work - even though another variable test showed the right number again. i also tried casting $var_to_test with int($var_to_test) I saw something about "blessing" a variable.. is this something i need to do? (i couldn't understand what blessing meant) |
PEBKAC :)
to access an element via index, you want to use Code:
$array_name[$index] Code:
@array_name[$index] also note that if you are declaring a variable with 'my' and assigning a value to it inside of a loop, it won't be available outside of that loop. |
its still failing with $
i tried passing it to another $ and i tried putting it directly into spawn2 it crashes zone either way.... i even tried closing the db connection - no dice. |
Well, I'd advise using the debugger to see what gets passed into the c++ side and also where it crashes.
|
ok lerxst2112,.. ill check into that if i can't find something useful in the logs
i think it might be somethign to do with teh mysql server actually.. sometimes it doesnt crash but a #dbspawn 2700947 or whatever will crash teh zone i'll do some more research.. i may be doing something bad to the db :P |
nevermind about this, it was a poor method of delivery.. i have devised an even less efficient method well see how it plays out ;o
|
All times are GMT -4. The time now is 07:35 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.