This master cog crashes the game now I've changed it to check for the difficulty level. I guess I have not put the jkSyncForcePowers() or the timer in the right place, with all the brackets I've used. Any ideas?
Code:
#Level master COG #Generated by JED 0.95 beta symbols message startup message timer int player local end code startup: // Register COG as master COG SetMasterCOG(GetSelfCOG()); player = GetLocalPlayerThing(); // Initialise Goals SetInv(player, 99, 1000); difficulty = GetDifficulty(); if (difficulty == 0) { SetGoalFlags(player,3,1); // Give player weapons and ammo SetInv(player, 1, 1); // fists SetInv(player, 2, 1); // briar SetInv(player, 3, 1); // ST Rifle SetInv(player, 4, 10); // Thermal Detonators SetInv(player, 11, 400); // Energy // Initialize weapon. SetFireWait(player, -1); SetMountWait(player, 0); SetCurInvWeapon(player, 1); SelectWeapon(player, AutoSelectWeapon(player, 1)); } if (difficulty == 1) { SetGoalFlags(player,3,1); // Give player weapons and ammo SetInv(player, 1, 1); // fists SetInv(player, 2, 1); // briar SetInv(player, 4, 6); // Thermal Detonators SetInv(player, 11, 200); // Energy // Initialize weapon. SetFireWait(player, -1); SetMountWait(player, 0); SetCurInvWeapon(player, 1); SelectWeapon(player, AutoSelectWeapon(player, 1)); } if (difficulty == 2) { SetGoalFlags(player,3,1); // Give player weapons and ammo SetInv(player, 1, 1); // fists SetInv(player, 2, 1); // briar SetInv(player, 10, 1); // Lightsaber SetInv(player, 11, 100); // Energy // Initialize weapon. SetFireWait(player, -1); SetMountWait(player, 0); SetCurInvWeapon(player, 1); SelectWeapon(player, AutoSelectWeapon(player, 1)); } SetTimer(15); timer: difficulty = GetDifficulty(); if (difficulty == 2) { SetInv(player, 20, 6); SetInv(player, 14, 6*50); SetInv(player, 21, 3.0); SetInvAvailable(player, 21, 1); SetInv(player, 22, 1.0); SetInvAvailable(player, 22, 1); SetInv(player, 23, 1.0); SetInvAvailable(player, 23, 1); SetInv(player, 24, 2.0); SetInvAvailable(player, 24, 1); SetInv(player, 25, 2.0); SetInvAvailable(player, 25, 2); SetInv(player, 26, 2.0); SetInvAvailable(player, 26, 2); jkSyncForcePowers(); return; } else return; end