odds-based triggers

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

tdwkillgasm

[[Iillegal userR]]]
Jun 5, 2003
164
0
0
38
uk
Visit site
i have set a trap on a map i'm making, does ne1 know whether i can set a trigger so there is a 1 in 10 chance of the player being caught if they walk into the trap?
 

Bot_40

Go in drains
Nov 3, 2001
2,914
0
36
York, UK
I made a quick script to do this (took 1 min to make and test).
To use it, open the map in the editor, then load your map and use the Actors -> Trigger -> RandomTriggerForwarder somewhere in your map and when you next save your map and the script will automatically be embedded in your map next time you save (so no worries about custom packages)
To get it to work you need to trigger it. Every time it is triggered by a regular trigger (or dispatcher or whatever) then there is a chance it will trigger whatever actors have the same tag as the random trigger's event.
You can set the probability, it should be a number between 0 and 1. If it's 0 then the event never occours, if it is 1 then the event always happens. 0.5 means the event will happen half the time.

The example map has one set up that will display a message "Triggered" about half the times you touch the normal trigger.
Plz gimmie credit in the readme if you release a map with it obviously :p


Edit: forgot to attach file.
 

Attachments

  • RandomTrigger.zip
    2.8 KB · Views: 14
Last edited: