Author Topic: Crashing when I run this code?  (Read 1649 times)

http://pastebin.com/TKtaxLL6

everything is explained there. basically, blockland is crashing when i run a certain function, and i'm not really sure why. attached is the related source code. there are no infinite loops as far as i know.


the relevant parts of the console.log are at the bottom of the pastebin.

I'm seeing "Entering serverCmdStopTalking" where it breaks, but I don't see a serverCmd function anywhere. Did you include all the code, or am I missing something?

Does "crashing" mean "freezing and becoming unresponsive" or "game dies with an error"

Your verbage and suspicion of infinite loops suggests freezing


Post the parts where you modify serverCmdStopTalking
« Last Edit: August 25, 2013, 11:34:54 AM by Lugnut »

It's freezing and becoming unresponsive. I don't think I modified serverCmdStopTalking. Maybe it was an add-on?

... try calling it manually.

/startTalking

/stopTalking

with trace

if it dies try something fun

for(%i = 0; %i < getNumActivePackages(); %i++) { echo(getActivePackage(1); }

uh... I think that's right. Check to see if those are functions, I'm rusty: echo(isFunction(getnumactivepackages)); echo(isfunction(getactivepackage));

... try calling it manually.

/startTalking

/stopTalking

with trace

if it dies try something fun

for(%i = 0; %i < getNumActivePackages(); %i++) { echo(getActivePackage(1); } i get a syntax error when i run this code

uh... I think that's right. Check to see if those are functions, I'm rusty: echo(isFunction(getnumactivepackages)); echo(isfunction(getactivepackage)); they're both funcs
it didn't die.

Code: [Select]
%vehicle = new Vehicle() { dataBlock = jeepVehicle; position = "24.5 -37 460"; };I think you're defining something wrong with the jeep, like using a Vehicle object instead of a WheeledVehicle object.



Other stuff:

Code: [Select]
clientGroup.getObject(%i).clearInventory(); //clears the client's inventory
clientGroup.getObject(%i).hasWon = 0; //reset their win status
You should set the client to a variable so that you only have to call the getObject method once.

Code: [Select]
mFloor(getRandom(1,miniGameList.size));No need for mFloor. getRandom returns an integer.

Code: [Select]
if(clientGroup.getObject(%i).player.mountVehicle == 0){//check if player isn't in a vehicle
    clientGroup.getObject(%i).bwLose();
Again, set the client to a variable.

Code: [Select]
minigameListThis isn't a problem but just an fyi, there is a default version of this: minigameGroup.

thanks guy.

the minigameList isn't actually a list of the blockland minigames. it's just a list of options for a literal minigame to play. as in not blockland's definition.
edit:
how could i delete the wheels when i spawn the jeep?]
double edit: it worked! i think it was crashing because of that vehicle thing.
« Last Edit: August 27, 2013, 10:07:12 PM by ultimamax »