Author Topic: Event programming  (Read 1336 times)

Hey, I'm kinda new, not really, but I was wondering how to program events. I would really like to know the one where you plant a brick and then touch it and it makes an explosion. Step-by-step instructions would be much appreciated.

-~-Kyzor-~-

1. Place a brick
2. Click it with wrench
3. Click Events
4. onPlayerTouch > Self > SpawnProjectile > TankShell(something like that)

Also, if you want to make it kill a player not in a minigame, make a new line and use the following event:

onPlayerTouch > Player > Kill

Ok, and where it says "Self", do you put your name? And where it says "Player", do you put the person's name who you want it to hit?

Ok, and where it says "Self", do you put your name? And where it says "Player", do you put the person's name who you want it to hit?
self=the brick you selected
player=who activated the event.
you gotta be kidding...

self=the brick you selected
player=who activated the event.
you gotta be kidding
how rude are you going to be to a noob?

meekl!!! you noob

Meekl, there's no need.
I'm sure you had trouble with events the first time you tried, too. :P

how rude are you going to be to a noob?

meekl!!! you noob
He is better than you'll ever be.

Hey, I'm kinda new, not really, but I was wondering how to program events. I would really like to know the one where you plant a brick and then touch it and it makes an explosion. Step-by-step instructions would be much appreciated.

-~-Kyzor-~-

I had to learn the whole events thing by myself, and yet, I am still not very good at it.

Keep Trying.

Ok, and where it says "Self", do you put your name? And where it says "Player", do you put the person's name who you want it to hit?

Those are targets.
Self would be the brick that the events are on.
Player would be the player that activated the event.

When you open up the wrench events dialogue, you'll notice there's a drop down menu waiting for you. The one in the first column is the input box. This is what defines when the following events will be triggered. For example,

onActivate - Triggers the events when a player clicks the brick
onPlayerTouch - Triggers the events when a player touches the brick

Most are self-explanitory, but you might have to do some trial and error to figure a few out. So, once you pick an input, a new box will pop up: your target box. This is what will be affected by the events. For example,

Self - The brick that the trigger was called for (i.e. the clicked brick)
Player - The player who triggered the event (i.e. who touched it)

Again, the names are usually a dead give away, but if you're not sure you can just try them and see what happens. Finally, after you've picked a target, you'll get your output box. This is where you select what will happen to your target. For example,

setColor - An output for brick targets that changes the color of the brick
IncScore - An output for client targets that increases their score

Once you have all of those, you can choose the output parameters, or options, that have to do with your output. Basically, for setColor, the parameter you have to select would be the color it's getting set to. Some events don't have parameters, and others have a lot.

You are also able to change whether the event can be activated or not by unchecking or checking off a box to the left of the event row; this is called it's enabled state. Next to that is also a box that has a "0" in it by default. This is the delay the event will wait before triggering. For example, if you have a 10000 delay (it's in millseconds) for an onActivate event, 10 seconds after someone clicks the brick, the output will be triggered for the target.

Example of it all put together:

(Enabled) (5000 Delay) onPlayerTouch -> Player -> Kill
Kills a player who touches the brick 5 seconds after they do so.

Ok, and where it says "Self", do you put your name? And where it says "Player", do you put the person's name who you want it to hit?

Player = the player
Self = The brick itself

i forgot what the other stuff is. =3

Meekl, there's no need.
I'm sure you had trouble with events the first time you tried, too. :P
I didn't have trouble. I just popped open the GUI and made a midi sequencer.

Thanks everyone for all your help, I am now very skilled with events, I just needed a little push in the right direction. I can't believe what I had been missing out on, events are really fun and can also be really funny. Thanks again.

-~Kyzor~-

Events are definitely NOT programming.

Whatever, I didn't have the right terminology at the time. Event... making, creating, setting, whatever, it doesn't matter as long as you get the idea.