~Tip of the Day~

I

iNsaNe

Guest
Did you know you can randomize special effects by using a simple trigger? It's pretty easy too. In my first example I will show you how to randomize variations of a special effect.

- The base of this special effect I will use is under Doodads, the full name is Doodads\Cinematic\GlowingRunes\GlowingRunes, let's copy and paste that because we will be needing it. Note that there is no .mdl at the end! Also notice that there are:

Doodads\Cinematic\GlowingRunes\GlowingRunes0.mdl
Doodads\Cinematic\GlowingRunes\GlowingRunes1.mdl
Doodads\Cinematic\GlowingRunes\GlowingRunes2.mdl
...
...
Doodads\Cinematic\GlowingRunes\GlowingRunes8.mdl

The one we copied and pasted is the base effect, if we use it in a trigger alone, it will do nothing.

So, now we have Doodads\Cinematic\GlowingRunes\GlowingRunes copied. We will need regions to place the special effects in so let's create some. In my trigger (for my new map), I have 12 regions so far.

Create a variable called Random_SFX, of type point and array.

Set up your trigger like this:

Code:
    Actions
        Set Random_SFX[1] = (Center of Rune 1 <gen>)
        Set Random_SFX[2] = (Center of Rune 2 <gen>)
        Set Random_SFX[3] = (Center of Rune 3 <gen>)
        Set Random_SFX[4] = (Center of Rune 4 <gen>)
        Set Random_SFX[5] = (Center of Rune 5 <gen>)
        Set Random_SFX[6] = (Center of Rune 6 <gen>)
        Set Random_SFX[7] = (Center of Rune 7 <gen>)
        Set Random_SFX[8] = (Center of Rune 8 <gen>)
        Set Random_SFX[9] = (Center of Rune 9 <gen>)
        Set Random_SFX[10] = (Center of Rune 10 <gen>)
        Set Random_SFX[11] = (Center of Rune 11 <gen>)
        Set Random_SFX[12] = (Center of Rune 12 <gen>)

Now the points where we will create the special effects are now stored in arrays. We will now get to the good part. To get call each array we will use a function called 'For Each Integer A, Do Multiple Actions'.

To call each array, set up your trigger like this:

Code:
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions

'From 1 to 12' can be anything, but those numbers represent the first array, Random_SFX[1] all the way to Random_SFX[12]

Now to randomize the effect! Under 'Loop' for 'For Each Integer A, Do Multiple Actions' go to: Special Effect - Create Special Effect at Point. Set the point to Random_SFX[(Integer A)], everytime For Each Integer A loops, it will call Random_SFX[1] all the way to Random_SFX[12] because its running from 1 to 12 each time. Some of you know that but I'm clearing it up for some beginning editors.

So far it should say, "Create a special effect at Random_SFX[(Integer A)] using..."

Now instead of choosing a model, we are going to use 3 different strings, using the Concentrate Strings function. Click on String 1 and hit ctrl + v (or paste), and it should paste Doodads\Cinematic\GlowingRunes\GlowingRunes. Click OK then click on String 2 and it should bring up another Concentrate Strings dialog. Click on String 1 and go to Conversion - Convert integer to string. At that new menu, it should by default say String((Player number of (Triggering Player))). Click on that and go to Math - Random Number; set the lower number to 0 and the higher number to 8 because 0 to 8 are the only number of variations of this effect. Hit OK twice and go to String 2, click on it, and type in the value box .mdl

Your string should look like this: Doodads\Cinematic\GlowingRunes\GlowingRunes + ((String(Random integer number between 0 and 8))) + .mdl))

Your final trigger should look like this:
Code:
Actions
    Set Random_SFX[1] = (Center of Rune 1 <gen>)
    Set Random_SFX[2] = (Center of Rune 2 <gen>)
    Set Random_SFX[3] = (Center of Rune 3 <gen>)
    Set Random_SFX[4] = (Center of Rune 4 <gen>)
    Set Random_SFX[5] = (Center of Rune 5 <gen>)
    Set Random_SFX[6] = (Center of Rune 6 <gen>)
    Set Random_SFX[7] = (Center of Rune 7 <gen>)
    Set Random_SFX[8] = (Center of Rune 8 <gen>)
    Set Random_SFX[9] = (Center of Rune 9 <gen>)
    Set Random_SFX[10] = (Center of Rune 10 <gen>)
    Set Random_SFX[11] = (Center of Rune 11 <gen>)
    Set Random_SFX[12] = (Center of Rune 12 <gen>)
    -------- ---------- --------
    For each (Integer A) from 1 to 12, do (Actions)
        Loop - Actions
            Special Effect - Create a special effect at Random_SFX[(Integer A)] using (Doodads\Cinematic\GlowingRunes\GlowingRunes + ((String((Random integer number between 0 and 8))) + .mdl))



- Yes there are point and special effect leaks, I don't feel like going into detail about those because that is not about the tip!! This tip may be a bit confusing at points because im tired right now and this is my first tip/tutorial/free trigger :eek:

Also this should go in the free trigger section but I would like to keep it here for others to see.

~Good luck map making
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top