Author Topic: miniGameCanDamage not being invoked + other stuff  (Read 1771 times)

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?

I have tried this method for fixing miniGameCanDamage:
Code: [Select]
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();
}

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.
« Last Edit: January 06, 2012, 11:55:40 AM by Port »

I'm not too sure about the first error, but finding the client of any object would look something like this:

Code: [Select]
%client = isObject(%obj.client) ? %obj.client : (isObject(%obj.sourceClient) ? %obj.sourceClient : getBrickGroupFromObject(%obj).client);

I'm not too sure about the first error, but finding the client of any object would look something like this:

Code: [Select]
%client = isObject(%obj.client) ? %obj.client : (isObject(%obj.sourceClient) ? %obj.sourceClient : getBrickGroupFromObject(%obj).client);

Sorry, but this is his 4500th post. Congrats.

Sorry, but this is his 4500th post. Congrats.

Congratulations!!!!!

My guess is you're trying to make some sort of gamemode that runs without a minigame.

This isn't a good idea. Blockland is designed to be a brick building game. All combat related stuff is handled by Minigames. Trying to break this system because you don't think your gamemode is "mini" anymore is ill-advised.

You can do a bunch of hacks, like returning a minigame object always in the function getMiniGameFromObject, but the end result is going to be exactly the same -- minus the leave/join messages. If that's your only grievance, your trickery might be better placed trying to hack out the messages.

Actually, I found some solution:
Code: [Select]
new fxDTSBrick() { position = "0 0 0"; datablock = brick1x1Data; }.delete();
This seems to fix it, oddly enough.

In no way shape or form does your "fix" make any sense. I strongly advise revisiting the problem.

To answer your second question, there is a function like getGroupFromObject(%obj).client
Fetch brick group, find client.

In no way shape or form does your "fix" make any sense.

Welcome to Blockland.

To answer your second question, there is a function like getGroupFromObject(%obj).client
Fetch brick group, find client.

Destiny already posted a method that works for projectiles, vehicles, etc as well.

My guess is you're trying to make some sort of gamemode that runs without a minigame.

I am making a system that allows for maps with a built-in brick save file that will be loaded and interactive map logic by performing specific actions when a map is loaded and other support systems for this.

-trying to get me to use mini-games instead snip-

Mini-games would be impractical in this situation due to their long list of drawbacks and how this is going to work. I do not feel that it is required for me to elaborate further on this subject.
« Last Edit: January 10, 2012, 03:45:50 AM by Port »

Mini-games would be impractical in this situation due to their long list of drawbacks and how this is going to work. I do not feel that it is required for me to elaborate further on this subject.
It's far easier to hack up minigames so that they work differently than to completely bypass them. What exactly are you trying to do?

It's far easier to hack up minigames so that they work differently than to completely bypass them. What exactly are you trying to do?

He's working on a super duper secret project, nobody will ever know!

Super-duper secret projects get coding help accordingly.

He's working on a super duper secret project, nobody will ever know!
I am making a system that allows for maps with a built-in brick save file that will be loaded and interactive map logic by performing specific actions when a map is loaded and other support systems for this.
???