Strings

krog99

New Member
Reaction score
2
I wanna make a zoom-trigger, which allows the player to zoom for a distance of choice.

For example if they wanna zoom out to 2400 they will type -zoom 2400 or -zoom 2050.

The hard part, i think, is splitting the string into two, and make first half standard. And then save second half in an integer Variable? Am i right?
 

Guest3z

New Member
Reaction score
22
Trigger:
  • YourTrigger
    • Events
      • Player - Player 1 (Red) types a chat message containing -Zoom as A substring
      • Player - Player 2 (Blue) types a chat message containing -Zoom as A substring
    • Conditions
    • Actions
      • Set IntegerVariable = (Integer((Substring((Entered chat string), 7, 10))))
      • Camera - Set (Triggering player)'s camera Height Offset to (Real(IntegerVariable)) over 0.00 seconds

Something like this? And just in case the first action is
Set Variable -> Convert String to Integer -> Substring

Hope this helps ;)
 

krog99

New Member
Reaction score
2
Trigger:
  • Set IntegerVariable = (Integer((Substring((Entered chat string), 7, 10))))


Thx, works fine, but why (7, 10) what is this part doing?
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
"-zoom " has 6 characters in it <---
01) -
02) z
03) o
04) o
05) m
06) <space>

So, it takes the numbers from the 7th character till the 10th and converts it from a string to an integer.
Then, it zooms the camera to the integer. =)
 
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