1. Fill your cup and take your pick among the maps best suited for this year's Hive Cup. The 6th Melee Mapping Contest Poll is up!
    Dismiss Notice
  2. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  3. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  4. 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.

Camera Zoom

Discussion in 'World Editor Help Zone' started by Illidan_Hunter, Jul 5, 2012.

  1. Illidan_Hunter

    Illidan_Hunter

    Joined:
    Dec 22, 2008
    Messages:
    479
    Resources:
    0
    Resources:
    0
    My trigger:
    • Camera - Set (Triggering player)'s camera Distance to target to (((Real((Entered chat string))) / 100.00) x 1650.00) over 1.00 seconds


    I want to set the camera to the % of the chat string I enter. For example, if I type '-cam 120' the zoom will be set to 120% of the standard W3 camera. Any ideeas how to do this?
     
  2. NarGalloth

    NarGalloth

    Joined:
    Apr 19, 2011
    Messages:
    441
    Resources:
    0
    Resources:
    0
    I don't know if it's possible to make that. However, you could try this event:

    • Player - Player 1 (red) types a chat message containing (-cam + (String(NUMBER))) as An exact match


    In the action you posted, change [Entered chat string] for NUMBER. (A real variable, call it however you want)

    In "NUMBER" you can write 120, 140, 160... whatever you want. I didn't try if it works, but I suppose that if you create some triggers with this, you could make the player able to zoom the camera to several different zooms. Then, you could send a message to the player and inform him about the different zooms he can set.
    I don't know if this can be made in order to accept any number you write, maybe others can help you with that.

    I hope this helped.

    Regards
     
  3. Mcasdf

    Mcasdf

    Joined:
    May 13, 2009
    Messages:
    248
    Resources:
    0
    Resources:
    0
    Use substring, it checks if "-cam" is in the message
    Player - Player 1 (Red) types a chat message containing -cam as A substring

    The condition is that the 4 first characters are exactly "-cam"
    (Substring((Entered chat string), 1, 4)) Equal to -cam

    Then set the variable to everything after: (5th char is a space so we skip it)
    Set variable = Real( substring((Entered chat string), 6, 100) )

    :)
     
  4. Illidan_Hunter

    Illidan_Hunter

    Joined:
    Dec 22, 2008
    Messages:
    479
    Resources:
    0
    Resources:
    0
    Thank you for your assist, Mcasdf. This helped me understand the subtrings function as well as fixing my trigger. I will add you to the credit list.

    Thread can be closed.