• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Variable

Status
Not open for further replies.
Level 4
Joined
Nov 21, 2004
Messages
47
Hello I'm trying to make a rpg and i need help with a few triggers that i can't get. The first one is that when the player types "-Inn 01 cost =(value)" it sets the variable "Inn_01_cost" to the stated "value". The second thing i need help with is the spawning triggers i dont know how to do it very well so any help is usefull. The third thing is for my quest i want it to give you the quest when u select the person but i cant find the condition so it has to be a specific unit. Thx all.
 
Level 6
Joined
Feb 4, 2005
Messages
302
First of all, I must warn you that I haven't touched the editor in 3 months, and can't, because my friend borrowed my CD and hasn't returned it.

1. I believe it's one of the events when a player types something as a substring. In this case, the substring should be "-Inn 01 cost=". So you can check the other part of what the player typed. I forgot how, but either you remove the substring or ignore it.

3. Which has to be a specific unit? The target or the player?
 
Level 5
Joined
Jul 31, 2004
Messages
108
Well, here's the simple (once you know how to do) trigger.

Code:
Inn Cost
    Events
        Player - Player 1 (Red) types a chat message containing -Inn Cost as A substring
    Conditions
        (Substring((Entered chat string), 1, 9)) Equal to -Inn Cost
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 10, 10)) Not equal to  
                (Substring((Entered chat string), 12, 12)) Not equal to  
            Then - Actions
                Game - Display to (All players) for 30.00 seconds the text: RAN!
                Set X = (Integer((Substring((Entered chat string), 10, 11))))
                Set Inn_Cost[X] = (Integer((Substring((Entered chat string), 12, (Length of (Entered chat string))))))
                Skip remaining actions
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 10, 10)) Equal to  
            Then - Actions
                Set X = (Integer((Substring((Entered chat string), 11, 12))))
            Else - Actions
                Set X = (Integer((Substring((Entered chat string), 10, 11))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Entered chat string), 13, 13)) Equal to  
            Then - Actions
                Set Inn_Cost[X] = (Integer((Substring((Entered chat string), 14, (Length of (Entered chat string))))))
            Else - Actions
                Set Inn_Cost[X] = (Integer((Substring((Entered chat string), 13, (Length of (Entered chat string))))))

Of course that is with the ability to do

-Inn Cost01450,
-Inn Cost 01450,
-Inn Cost01 450,

Any of those should work.

~TheDarkestHour

I'll post help on your other triggers later. It's too late.
 
Level 5
Joined
Jul 31, 2004
Messages
108
Spawn trigger-

Code:
Spawn
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        Unit - Create 2 Footman for Player 2 (Blue) at (Random point in (Playable map area)) facing (Random angle) degrees

Select Trigger
Code:
Selected Unit
    Events
        Player - Player 1 (Red) Selects a unit
    Conditions
        (Triggering unit) Equal to Unit
    Actions
        Game - Display to (All players) for 30.00 seconds the text: You win a toaster!

Alright. I hope you learned somethings, and try to figure these out before you post.

~TheDarkestHour
 
Status
Not open for further replies.
Top