Author Topic: Gamemode creation  (Read 1309 times)

Hey guys! Once again. I'm working on a new FPS campaign! One I actually intend to finish because the gameplay style I plan for it works like a hand in a glove in Blockland.

But there's an issue.

When the player loads the map, I don't want any of the enemy bots to be spawned until their relative triggers are activated. The same goes for doors, which I don't want to be open at the start of a minigame. Oh, and the secrets as well. ;) The problem is that there doesn't seem to be an OnMinigameStart event. There's the minigamereset event, but I don't think the player should have to reset the minigame once they start playing just so the whole map can work properly. There, IS the onminigameroundstart event  for slayer, but due to complications with bots and the general way it works, I'm only using the default gamemode.

If we can't think of a way, I guess i'll have to put a readable sign at the start that tells the player to reset the minigame in order to open the first door and exit the first temple.

ALSO, any of you know how to package a minigame? I uh...don't actually know how to create one. I remember there being some kind of add-on in the past and I'll look for that, but other than that, I'm clueless after I've finished building the campaign. 

PS: I'm a simpleton, so please speak in layman's terms:)

you'll need to use onMinigameReset. If you want to emulate onMinigameStart, have a spawn brick that resets the minigame and use onMinigameReset to cancel that previous event

if it's a map that the player progresses through, you can use events on the initial spawn to reset the map each time
this way it works on where the player is, instead of a minigame reseting

Thanks guys. I'll try this out a little later to see if it works.


Ok, I don't know if my copy of the game needs to be reinstalled or whatever, but the event isn't working. Onminigamereset is not working for the bot spawns and it's really getting on my nerves. As an example of what I'm doing, I'll show the events put on each bot spawn:

(random events for the bots health and weapon etc)

Onminigamereset --> self --> setBotType --> None

I then manually reset the minigame after restarting, and when I exit the temple, the bots are STILL THERE! I know something's up because I evented a music brick to start playing music upon a minigame restart and it works perfectly fine. In fact it works SO well that I don't even need to restart the game. The music begins playing when I join the first time. This is the same for any other non-bot brick, seeing as the doors respond the same, being closed upon joining the minigame like i want them too.

So yeah, it just doesn't work with bot spawns for some reason and it's driving me freakin crazy trying to figure out why. What makes them so different that events fail to work on them like they should others? I don't get it and it's made the campaign impossible until I can figure it out.

try putting a delay
there's a moment where events won't work after a player spawns, if the minigame resets they respawn and events shouldn't do things to them for a few seconds

I actually did try putting a delay on it, but never more than 100 miliseconds. I'll try giving five seconds a shot.

try putting a delay
there's a moment where events won't work after a player spawns, if the minigame resets they respawn and events shouldn't do things to them for a few seconds

You were right on point man! I've found out that there needs to be a minimum of 400 milliseconds for the event to work. You just saved my whole build man. Thank you! :)