Author Topic: Getting rkynick's Mafia Mod to Work  (Read 696 times)

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: [Select]
Add-Ons/Mod_Mafia/Weapon_Mafiachoose.cs (321): Unable to find object: '0' attempting to call function 'setControlObject'
2nd error:
Code: [Select]
Add-Ons/Mod_Mafia/Weapon_Mafiachoose.cs (320): Unable to find object: '' attempting to call function 'setOrbitMode'so i looked at the file weapon_Mafiachoose.cs at line 305-3523 and here is that code:
Code: [Select]
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();
}
I can't figure out what is wrong, help would be appreciated.

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.

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.
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.

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.
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?

Must have non-existent clients in the $mafia_client array

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