Author Topic: Eventing help  (Read 666 times)

I'm wondering is there a way with events you can limit people per area of a build?
I'm intending on using it for arenas for saying 10 people per match then when it's done they get re-spawned out. I'm just unsure on how to do this.

Not sure what you want, but I think I have an idea, with multiple ways to approach it.

First way: actual events, possibly best way.

Make the arena and a spawn room.  Put a visible brick in the spawn room and an invisible brick in the arena, this is called ARENA.  The below events go on the spawn room brick.

[ 0] [onactivate] [Self] [VCE_Ifvariable] [players] [==] [10] [1 4]
[1] [onvariablefalse] [Self] [VCE_Modvariable] [players] [add] [1]
[2] [onvariabletrue] [Namedbrick] [ARENA] [setplayertransform] [ ] [ ]
[3] [onvariabletrue] [Self] [disappear] [-1]
[4] [Onvariabletrue] [Self] [VCE_Modvariable] [players] [set]
  • [5]
[onminigamekill] [self] [VCE_Ifvariable] [kills] [>=] [9] [6
[6] [onvariablefalse] [self] [VCE_Modvariable] [kills] [add] [1]
[7] [onvariabletrue] [Self] [disappear]
  • [8]
[onvariabletrue] [Self] [VCE_Modvariable] [kills] [set]


I'm still unsure of the minigame event comparability with VCE because I know of a few discrepancies, so these may or may not work.  Also, this was just a base for the system.  It is very basic.  Please don't just use this if it works, add some pizzazz and prettiness.

Gen, I dont believe this is what he is talking about.
Also, vce works just fine with any input event. Why wouldnt it?

And, ftr, using code tags with events helps tremendously.

Code: [Select]
[0]  OnMinigameSpawn   Self          vce_ifVariable        Players    <         10    1  3
[1]  OnVariableTrue         Self          vce_ModVariable  Players    add    1
[2]  OnVariableTrue      nb_Arena1  setPlayerTransform
[3]  OnVariableFalse     nb_Arena2  setPlayerTransform
[4]  OnMinigameKill      KillerClient  vce_ifVariable  Kills        <         25

Thats how the arena thing would work.
However, VCE input events lack a KillerClient target. Gen your events would end the minigame after there were 10 total kills, because the variable is managed within the brick itself. The correct way to do this would be to instead have the KillerClient handle the variable, and then have the brick do a check onMinigameKill.
Resetting the minigame via points would be done like so:
Code: [Select]
[0]  OnMinigameKill   KillerClient   vce_ifValue   <var:cl:score>   ==    10     1  2
[1]  OnVariableTrue   Minigame     messageAll   Somebody has won the game! Resetting minigame!
[2]  OnVariableTrue   Minigame     Reset
Hope this helps.

I wrote this from my kindle fire, so, any typos / errors, sorry.

set the player limit to 10, and put ten spawns in the arena

Yes, but you have to have all these events installed, since a few of them (like setPlayerTransform) are addons.

Hothauser appears to be using 2 event mods:
Variable Conditional Events (VCE)
setPlayerTransform

Hope I helped maybe a little. :)

Gen, I dont believe this is what he is talking about.
Also, vce works just fine with any input event. Why wouldnt it?

And, ftr, using code tags with events helps tremendously.

Code: [Select]
[0]  OnMinigameSpawn   Self          vce_ifVariable        Players    <         10    1  3
[1]  OnVariableTrue         Self          vce_ModVariable  Players    add    1
[2]  OnVariableTrue      nb_Arena1  setPlayerTransform
[3]  OnVariableFalse     nb_Arena2  setPlayerTransform
[4]  OnMinigameKill      KillerClient  vce_ifVariable  Kills        <         25

Thats how the arena thing would work.
However, VCE input events lack a KillerClient target. Gen your events would end the minigame after there were 10 total kills, because the variable is managed within the brick itself. The correct way to do this would be to instead have the KillerClient handle the variable, and then have the brick do a check onMinigameKill.
Resetting the minigame via points would be done like so:
Code: [Select]
[0]  OnMinigameKill   KillerClient   vce_ifValue   <var:cl:score>   ==    10     1  2
[1]  OnVariableTrue   Minigame     messageAll   Somebody has won the game! Resetting minigame!
[2]  OnVariableTrue   Minigame     Reset
Hope this helps.

I wrote this from my kindle fire, so, any typos / errors, sorry.

No, you don't understand.

What he wants:

10 players per arena, multiple arenas.  I would suggest using my way because that way, kids can choose which arena to fight in.  This way, they can play with their friends instead of random joining of the arenas.

Unfortunately, neither of our reset tactics will work, because yours is wrong and I wrote mine when I was tired and didn't understand that he wanted multiple arenas.  I could think of a good way to do a tournament type set up and avoid the whole minigame reset.  Please see below for this set up.

Scenario: one spawn room, four regular arenas, one final arena with one rest room on each side.  Four bricks in the spawn room, each to one regular arena.  For example's purposes, these are SPAWN#.  There is one brick in each arena, these are called ARENA#.  Make another arena, this is the final one where all the winners culminate to fight, you will need an ARENA# here too.  In each arena, make a brick in the wall that acts as a gate, GATE#, which will disappear.  Behind each gate, place a zonebrick, this zonebrick is called ZONE#.  The rest rooms need an invisible brick called REST#, a zonebrick called FINAL#, and a clear wall blocking the rest rooms from the arena, these are FINALGATE, with no #.

Replace all # with the number of the arena.

SPAWN#:

Code: [Select]
[0] [Onactivate] [Self] [VCE_Ifvariable] [Brick] [players] [==] [10] [1 4]
[1] [Onvariablefalse] [Self] [VCE_Modvariable] [players] [add] [1]
[2] [Onvariablefalse] [Client] [VCE_Modvariable] [arena] [set] [#]
[3] [Onvariabletrue] [Namedbrick] [ARENA#] [Setplayertransform] [ ] [ ]
[4] [Onvariabletrue] [Self] [disappear] [-1]

[5] [Onminigamekill] [VictimClient] [VCE_Ifvariable] [arena] [==] [#] [7 7]
[6] [Onminigamedeath] [VictimClient] [VCE_Ifvariable] [arena] [==] [#] [7 7]
[7] [Onvariabletrue] [Self] [VCE_Ifvariable] [Brick] [kills] [==] [8] [8 10]
[8] [Onvariablefalse] [Self] [VCE_Modvariable] [Kills] [add] [1]
[9] [Onvariablefalse] [Client] [VCE_Modvariable] [arena] [set] [0]
[10] [Onvariabletrue] [Namedbrick] [GATE] [disappear] [-1]

ZONE# (tournament variety):

Code: [Select]
[0] [Onplayerenterzone] [Self] [VCE_Modvariable] [winner] [set] [<var:cl:name>]
[1] [Onplayerenterzone] [Namedbrick] [SPAWN#] [disappear] [0]
[2] [Onplayerenterzone] [Minigamecenterprintall] [<var:br:winner> won Arena#]
[3] [Onplayerenterzone] [Namedbrick] [REST#] [setplayertransform] [ ] [ ]
[4] [Onplayerleavezone] [Namedbrick] [disappear] [0]
[5] [Onplayerleavezone] [Client] [VCE_Modvariable] [arena] [Set] [0]

FINAL:

Code: [Select]
[0] [Onplayerenterzone] [Namedbrick] [CENTER] [VCE_Modvariable] [arena#] [set] [1]
[1] [Onplayerenterzone] [Self] [VCE_Ifvalue] [<var:nb_CENTER:arena1>] [==] [1] [2 2]
[2] [Onvariabletrue] [Self] [VCE_Ifvalue] [<var:nb_CENTER:arena2>] [==] [1] [3 3]
[3] [Onvariabletrue] [Self] [VCE_Ifvalue] [<var:nb_CENTER:arena3>] [==] [1] [4 4]
[4] [Onvariabletrue] [Self] [VCE_Ifvalue] [<var:nb_CENTER:arena4>] [==] [1] [5 9]
[5] [Onvariabletrue] [Namebrick] [FINALGATE] [disappear] [-1]
[6] [Onvariabletrue] [Namebrick] [CENTER] [VCE_Modvariable] [arena1] [set] [0]
[7] [Onvariabletrue] [Namebrick] [CENTER] [VCE_Modvariable] [arena2] [set] [0]
[8] [Onvariabletrue] [Namebrick] [CENTER] [VCE_Modvariable] [arena3] [set] [0]
[9] [Onvariabletrue] [Namebrick] [CENTER] [VCE_Modvariable] [arena4] [set] [0]

That's pretty much it for simple tournament set up.  The only thing you then need is another zone or brick that kills the winner and makes the FINALGATE reappear.  I think you can handle taking the ZONE# events and changing them to this.

ZONE# (non-tournament variety):

Code: [Select]
[0] [Onplayerenterzone] [Self] [VCE_Modvariable] [Brick] [winner] [set] [<var:cl:name>]
[1] [Onplayerenterzone] [Client] [Minigamecenterprintall] [<var:br:winner> won in arena#]
[2] [Onplayerenterzone] [Client] [VCE_Modvariable] [arena] [set] [0]
[3] [Onplayerenterzone] [Player] [Kill]
[4] [Onplayerleavezone] [Namedbrick] [Gate#] [Disappear] [0]

That should be all.  There may be some missing variable resets because of how fast I was typing this, but I assume you should be able to fix it.

This is much better than the crap I wrote when I was tired, in bed, and half asleep.