Triggers  (Read 19937 times)

Snipe34

  • 1337
  • *
  • Posts: 945
  • Country: au
Triggers
« on: May 26, 2010, 20:41 »
Poompoom was wondering about olde Tower Triggers - Pix, who who made the map explained to me how he did that, so I'll pass it along here.
And I added some other trigger info as well that could be useful in your map/maps.

I said in another post copy/paste isn't so good with meshes/tex best to use mylevel transfer (load map you want to extract meshes/tex from, then load your map and meshes/tex will now be in your map's mylevel, but what you don't use will vanish from your mylevel next time you load your map.)
But copy/paste is best for standard emitters/network emitters because they are such a pain.  There is a big difference between standard/network emitters.  Emitters can be triggered, that's why I included them in this tutorial.  But standard emitters won't trigger online - network emitters will.

The pic below shows a trader door selected in oldeTower, and you notice ClosingEvent: Add_to_counter.  (Add_to_counter tag is also shown in next pic inside a counter)  After each round the trader door opens/closes which adds to the counters.  Triggers/counters open the doors of each new stage of oldeTower.  They also do other stuff like open doors to teleports and beside his row of counters is a ScriptedTrigger that actions that other stuff.




2/
Using counters similar to Pix' oldeTower:
The next pic shows the counter I used to trigger the plane crash in airportSpecimens:  EVENT: crash1  TAG: crashSwitchX.  The COUNTER shows numberToCount: 4 (obviously bMessage off so player doesn't know there is a count).
So numberToCount 4 means there are four standard triggers scattered around the airport that players will trip.  Their EVENT is crashSwitchX - the player walks over them, triggers them, and that is sent to the counter, after four are triggered the crash event begins.  (i forgot to picture in the standard trigger:  Trigger: bTriggerOnceOnly True - because if the player touches one trigger he keeps sending trigger;trigger;trigger etc to the counter, like the spam you see when you stand on a weapon you already have).

[Note standard trigger is found in: actors>Triggers>Trigger]

And I forgot to show in the pic, last important feature of standard trigger option that I used and you should be know about.  I made it a "classTrigger"  - in the standard trigger's trigger section: classProximityType is KFmod.KFHumanPawn, otherwise zombies will trip it and I didn't want that.  (click on standard trigger classProximityType [quick find: type in kfhu and will take you to KFHumanPawn])  Finally for same area of standard trigger: TriggerType: TT_ClassProximity.




3/
ScriptedTrigger

[note: ScriptedTrigger is found in actors>keypoint>aiscript>scriptedsequence>scriptedtrigger]

These Triggers are used for pre-scripted sequences.  A ScriptedTrigger activated by a standard trigger are also the best combo for online.  But scriptedTriggers have many scripts for UT like "crouch" for the bots, obviously redundant for KF.  Mainly I use "waitForEvent" "TriggerEvent" "WaitForTimer" the "IF" condition and "IFRandomPct" "playSound" which I used in scriptedTriggers in Horztal.  Have a look through that map at the scriptedTriggers if you're curious.

The pic below shows the pre-scripted sequences I used for the airport crash.  (the scripted trigger itself is just below the 'to gates' sign)

In the Scripted Trigger: AIScript;Actions: WaitForEvent is Crash1 (the event as above triggered by the Counter).  Next scripted action is TriggerEvent: CrashGo - the plane mover has that Tag, so it will start flying.
Next action is WaitForTimer: 6.  (I saw how long it took for the plane to get to the airport and it was about 6.)
Next action: TriggerEvent: blastRoofAir1 (triggers roof mover to go away - and does other stuff).
Next action: playExplosionSound.
Next action: WaitForTimer: 3
WaitForTimer is an important command -according to UT docs- because a scriptedTrigger's commands if not paused with WaitForTimer sometimes can spam a CPU - and in this case if there is no WaitForTimer, the sound won't be played - script will move quickly to the next command.  The WaitFortimer 3 should be more like 6 so the sound plays properly, but things must happen quickly with the plane crash... so I'm not totally happy with the plane crash...  I didn't hear the glass smash sound and only one explosion sound :/  But there is a long creaking metal sound at the end lol - because it has time to play.


4/  Next pic a viewShaker - makes the player's view shake... what else...??

[Found in >actors>triggers>viewShaker]

There is a scripted action in scriptedTriggers for viewshake but it doesn't seem to work.  Careful with viewShaker settings, i changed some and found my view sliding right across the map - only view and i was clipping through everything so i didn't die.


   
5/ Next pic below, emitters. Note on the selection it has "NetworkEmitter"

The best way to get an emitter is copy and paste from someone else's map, even Alex who made KF recommended that method.  I have selections from UT that I copied into a KF map that I use.  Problem then if a triggered network emitter is required setting have to be transferred xd.  I know my way around emitters roughly to alter settings but they're still a major pain.
Not pictured - in network emitters -to trigger or not trigger-:  emitter;local:disabled=true  respawnDeadParticles=false (otherwise it may keep emitting).  Then Spawning=AutomaticInitialSpawning=false (so the emitter doesn't spawn until triggered).   Trigger:(i think this option is there for non-network - I never touch it expect for initial particles - and changing that can sometimes break the emitter and crash the game...)
Good luck with emitters ><
One more thing, if you're changing an emitter's setting don't have realtime activated -joystick icon- I trashed a map when i did that.


6/ TriggerLight, pic below.

[found in actor>light>triggerlight]

Tricky things - I first tried one on standard settings in gothic for the fire and it lit the whole house bright glowing orange colour, I wondered wtf happened.  So lighting;lightRadius=10 is probably the safest maximum.  lightcolor;lightBrightness= doesn't matter so much, but max is 255.


Any questions, feel free.  But if you have other tuts, best "start new topic" otherwise too cluttered.

poompoom500

  • 1337
  • *
  • Posts: 708
  • Country: us
  • For my one and only Dottie.
    • poompoom500
    • poompoom500
Re: Triggers
« Reply #1 on: May 27, 2010, 01:22 »
 :-[ To jeetkunedo,

Quote
Where did you learn all this stuff...?
Whoa! The question of all questions! Might I hazard a guess? Me thinks he learned it from his mom. ;) (Just pulling your leg, jeet). But the tut above is very informational. And thank you dood.

Snipe34

  • 1337
  • *
  • Posts: 945
  • Country: au
Re: Triggers
« Reply #2 on: May 27, 2010, 16:31 »
:-[ To jeetkunedo,

Quote
Where did you learn all this stuff...?
Whoa! The question of all questions! Might I hazard a guess? Me thinks he learned it from his mom. ;) (Just pulling your leg, jeet). But the tut above is very informational. And thank you dood.

My mother is dead.

Where did you learn all this stuff...?

Google, and docs...







poompoom500

  • 1337
  • *
  • Posts: 708
  • Country: us
  • For my one and only Dottie.
    • poompoom500
    • poompoom500
Re: Triggers
« Reply #3 on: May 27, 2010, 16:56 »
 :-[ To Snipe34,

Quote
My mother is dead.
No disrespect intended. I was just joshng around.

[MiA]Raj

  • 1337
  • *
  • Posts: 1274
  • Country: ee
    • rajliv
Re: Triggers
« Reply #4 on: May 28, 2010, 16:20 »
Thanks for tutorial!  ;)

[MiA]afx0r

  • Full MemberĀ 
  • *
  • Posts: 91
  • Country: ar
Re: Triggers
« Reply #5 on: May 31, 2010, 09:17 »
All this info is gold =)
Thanks Snipe!

Snipe34

  • 1337
  • *
  • Posts: 945
  • Country: au
Re: Triggers
« Reply #6 on: June 11, 2010, 02:45 »
All this info is gold =)
Thanks Snipe!

Thanks mate :)

poompoom500

  • 1337
  • *
  • Posts: 708
  • Country: us
  • For my one and only Dottie.
    • poompoom500
    • poompoom500
Re: Triggers
« Reply #7 on: June 11, 2010, 07:11 »
 :) To Snipe34,

Yepper man! All these information is GOLD. And I was wondering if you can make a tutorial on Physics Volume. I haven't checked your new map 737 but isn't that what you used for the wing pulling effect?