Blockland Forums > Modification Help

Getting rkynick's Mafia Mod to Work

Pages: (1/1)

Knil:

I downloaded rkynick's mafia mod from his code dump topic. I got everything to work except it gave me two errors.

The first error was:

--- Code: ---Add-Ons/Mod_Mafia/Weapon_Mafiachoose.cs (321): Unable to find object: '0' attempting to call function 'setControlObject'

--- End code ---
2nd error:

--- Code: ---Add-Ons/Mod_Mafia/Weapon_Mafiachoose.cs (320): Unable to find object: '' attempting to call function 'setOrbitMode'
--- End code ---
so i looked at the file weapon_Mafiachoose.cs at line 305-3523 and here is that code:

--- Code: ---function nextmafiaturn(){
$Mafia_client[$Mafia_turn].isturn=0;
$Mafia_turn++;
if($mafia_turn==1){
announce("It is now night, you may not talk. You will take turns waking up and doing your job.");
}else{

%client=$mafia_client[$mafia_turn-1];
%temp=new StaticShape() {
position="0 0 -300";
scale="0.001 0.001 0.001";
dataBlock=LCD;
};
missionCleanup.add(%temp);
%cam=%client.camera;
%client.setcontrolobject(%cam);
%cam.setOrbitMode(%temp,"0 0 -300",0,0,0,0);
%temp.delete();
}
--- End code ---
I can't figure out what is wrong, help would be appreciated.

DYLANzzz:

Well are you sure that %client=$mafia_client[$mafia_turn-1]; works because it says object 0 is trying to call something.

Echo what %client is.

Knil:


--- Quote from: DYLANzzz on September 12, 2010, 10:34:06 PM ---Well are you sure that %client=$mafia_client[$mafia_turn-1]; works because it says object 0 is trying to call something.

Echo what %client is.

--- End quote ---
I honestly have no idea if it is working.
And how exactly do i echo what %client is, I'm new to this whole scripting deal.
all i understand from the code is that it's suppose to make the players who aren't going see only under the map.

DYLANzzz:


--- Quote from: Knil on September 12, 2010, 11:46:54 PM ---I honestly have no idea if it is working.
And how exactly do i echo what %client is, I'm new to this whole scripting deal.
all i understand from the code is that it's suppose to make the players who aren't going see only under the map.

--- End quote ---
Do you get this error when executing? Forgot to ask that.

And it would be echo(%client); and then tell me what number it outputs in console. If its zero, -1, or something then %client=$mafia_client[$mafia_turn-1]; is broken.

Where is this topic?

rkynick:

Must have non-existent clients in the $mafia_client array

Add a if(isobject(%client)){ check after the %client= ... line

Pages: (1/1)

Go to full version