| Blockland Forums > Modification Help |
| miniGameCanDamage not being invoked + other stuff |
| (1/3) > >> |
| Port:
I have noticed something rather odd while trying to modify the mini-game system. miniGameCanDamage( obj, col ) is not invoked (called, executed, whatever) when damage should be applied unless a mini-game is currently active or has ever been active. Is there anything I can do to make this function run at any time? Another question: What is the best way to determine the client of an object of pretty much any type, including but not limited to players, bots, projectiles, explosions, bricks, items and vehicles? |
| Port:
I have tried this method for fixing miniGameCanDamage: --- Code: ---function fixMiniGameCanDamage() { %owner = new AIConnection() { name = ""; bl_id = -1; }; %miniGame = createMiniGameSO( %owner, "Temporary Mini-Game", false, true ); %miniGame.endGame(); if ( isObject( %miniGame ) ) { %miniGame.delete(); } %owner.delete(); } --- End code --- From this, I got an error somewhat like the following, and miniGameCanDamage also wasn't fixed: ERROR: miniGameSO::addMember - object "something" is not a client. This method is for adding clients to the minigame only. I have also tried with a gameConnection, which you indeed can manually create server-sided. This works fine, except the server crashes when it attempts to create a mini-game with the virtual client. I'm now going to try this method again, except this time I'll prevent network-related actions on this virtual client. |
| Destiny/Zack0Wack0:
I'm not too sure about the first error, but finding the client of any object would look something like this: --- Code: ---%client = isObject(%obj.client) ? %obj.client : (isObject(%obj.sourceClient) ? %obj.sourceClient : getBrickGroupFromObject(%obj).client); --- End code --- |
| Darkness ZXW:
--- Quote from: Destiny/Zack0Wack0 on January 06, 2012, 07:31:45 PM ---I'm not too sure about the first error, but finding the client of any object would look something like this: --- Code: ---%client = isObject(%obj.client) ? %obj.client : (isObject(%obj.sourceClient) ? %obj.sourceClient : getBrickGroupFromObject(%obj).client); --- End code --- --- End quote --- Sorry, but this is his 4500th post. Congrats. |
| Honorable:
--- Quote from: Darkness ZXW on January 07, 2012, 12:19:15 PM ---Sorry, but this is his 4500th post. Congrats. --- End quote --- Congratulations!!!!! |
| Navigation |
| Message Index |
| Next page |