Wrench Events Tutorial (learn some stuff here)

Author Topic: Wrench Events Tutorial (learn some stuff here)  (Read 18317 times)

What is parameters for?

What is parameters for?

for the rocket? if it is its how far, or direction it shoots

Oh you can add "setvelocity"  0 , 0 , 25...at least to make the landmine more realistic when you touch it...

Oh you can add "setvelocity"  0 , 0 , 25...at least to make the landmine more realistic when you touch it...

no, land mines to launch you in air... but i will i guess



A 10 loving minute bump?



Here is a bi-conditional statement. "If a player has shot a target and then touches another brick, something happens." You can easily add a toggle that keeps players from shooting the target twice and turning the shot status off. On Switch1 add the event onprojectilehit self toggleEventEnabled 0 1. Change event 0 to toggleEventEnabled 0 1 2. On Switch 2 add event 2, (disabled) onplayertouch NamedBrick Switch1 toggleEventEnabled 0 1. Change event 0 to say onplayertouch self toggleEventEnabled 0 1 2.

If you connect this up to a timer, you can make events where you have to shoot a target and then run to another brick before the timer reaches 0 to open a door. This is a really neat component to challenges and obstacle courses (I happen to be working on a single player one right now).

In order to make land mines, you should pile all of your explosion effects into onrelays. Then set up the following events:
onplayertouch self firerelay
onprojectilehit self firerelay
onbottouch self firerelay
onactivate self firerelay

This makes your mine explode if someone touches, shoots, runs over it in a horse or activates it, and makes your mines more realistic. In addition to the spawnexplosion effect, you should also include a fakekillbrick event and make your mine respawn after 20 seconds- its more fair.

In my opinion, most minefields can more efficiently be replaced with an "artillery field." It's basically a flat 64x64 that, after some number of seconds, spawns .2 sized tank shell explosions, then after an even greater number of time, .5 sized tank shell explosions, then up to 1 and finally 2. It simulates artillery fire being directed at a player, with the delay acting as the "loading time." The barrage will also continue a few seconds after the player leaves the plate, simulating shells already traveling to the location after the crew has stopped shelling. It saves all those events on mines so you can use them on cooler things, like jet-pack vending machines or respawning health kits.

Speaking of jet-pack vending machines and respawning healthkits, here are the events you have to use to make them. While it's really basic stuff, it does demonstrate an excellent way to create spam proof triggers- triggers that you can only activate once until a certain amount of time has elapsed. Consider using this method in your next missile turret to create a realistic and balanced reloading period instead of an extremely annoying, loud, and over powered missile spamming device.
Jetpack vending machine:
0      onActivate Player ChangeDatablock Fuel-Jet Player
0      onActivate   Self SetRaycasting   unchecked
30000  onActivate   Self SetRaycasting   checked

This gives a player fuel-jets and then waits 30 seconds before letting another person get them.

Respawning Healthkit:
0 onPlayerTouch Player AddHealth     25
0 onPlayerTouch Self   PlaySound     beep_popup.wav
0 onPlayerTouch Client ChatMessage   You have gained 25 health.
0 onPlayerTouch Self   FakeKillBrick 0 0 0 20

This creates a healthkit that heals a player, plays a healing sound, tells them they've been healed, and then respawns 20 seconds later.

King of the hill scoring trigger:
0      onPlayerTouch Client IncScore      1
0      onPlayerTouch Self   SetRaycasting unchecked
1000   onPlayerTouch Self   SetRaycasting checked

This gives a person one point for every second they stand on a brick. OnPlayerTouch causes a few problems though- only one person is effected at a time. In this case, if there are two people standing on the brick, whoever most recently touched the brick will get the time. It just gives incentive for people to keep other people off the hill. You can have more than one hill, and you can give different "hills" different point values.

Note that wherever I say realism in this post, I just mean fair and balanced in deathmatches. There is nothing realistic about tiny land mines exploding when a plastic figure walks over them.
« Last Edit: August 11, 2008, 03:34:18 PM by Wedge »


No I don't, I was just making a better light tutorial.

Nice work, Wedge :D
Oh, and idea for you king of the hill thing, why not include that you should have Push Brooms to push them off the KotH point?
« Last Edit: August 11, 2008, 06:29:31 PM by -Nick- »

So setraycasting is like saying whether or not it can do it's events or not?

Is it possible to make the bots move? They just stand there...
« Last Edit: August 11, 2008, 09:33:01 PM by DominicTheDonkey »

I would LOVE to know how to make a keypad.

I would LOVE to know how to make a keypad.

that makes music?

Is it possible to make the bots move? They just stand there...

All they do is stand there until the real bots are made

Single player challenge you say wedge?:D I might make one too.
I had that idea before i read that post, Cant wait to see it!