1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Variable

Discussion in 'Map Development' started by nojix, Sep 4, 2005.

  1. nojix

    nojix

    Joined:
    Nov 21, 2004
    Messages:
    47
    Resources:
    0
    Resources:
    0
    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.
     
  2. Telefragged

    Telefragged

    Joined:
    Feb 4, 2005
    Messages:
    311
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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?
     
  3. PalidinMaster3

    PalidinMaster3

    Joined:
    Jul 31, 2004
    Messages:
    108
    Resources:
    0
    Resources:
    0
    Well, here's the simple (once you know how to do) trigger.

    Code (Text):
    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.
     
  4. PalidinMaster3

    PalidinMaster3

    Joined:
    Jul 31, 2004
    Messages:
    108
    Resources:
    0
    Resources:
    0
    Spawn trigger-

    Code (Text):

    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 (Text):

    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