? RTS selection help (Page 1) ● SmileBASIC Source Forums

Sign In

*Usernames are case-sensitive
Forgot my password
What's going on?? See: Site Update March 2022

RTS selection help

  • #1 ✎ 7 therx1 I've been trying to make a RTS selection box that can actually detect sprites and return a value. When I use sphitrc it doesn't return anything because getting the witdh and height of a RTS selection box is hard when the arguments doesnt like zeroes. I'm wondering if anyone can help me find the width and height of a selection box (what I mean by a selection box is the type you use on your desktop to move application, in MOBAS to move your here's or in RTS games to move units). An alternative method on doing this is also welcomed ^-^. Posted
  • #2 ✎ 1093 Yolkai Head Admin You should keep track of your units with an array instead of trying to detect them with a collision hack. Posted
  • #3 ✎ 7 therx1 can you explain pls? how would i know if it hits my selection box if my units are in an array? also what would i even put in the array? Posted
  • #4 ✎ 1093 Yolkai Head Admin You know if it contains them because your array would contain the locations of your units and you know the location/dimensions of your selection region. It seems I missed your real initial problem, "find the width and height of a selection box," because it wasn't clear. What are you doing to create this region? How does the user create it? Posted Edited by Yolkai
  • #5 ✎ 7 therx1 The first point (the top left corner) is started when you are touching the screen and x is pressed, and the 2nd point just follows the where the touch screen is tapped. Posted
  • #6 ✎ 7 therx1 bumping so more people see Posted
  • #7 ✎ 477 SquareFingers
    bumping so more people see
    Yeah, please don't spam. Do you know TOUCH, and all its components?
  • #8 ✎ 7 therx1 yes, thats what i am using. Posted
  • #9 ✎ 477 SquareFingers And how are you using SPHITRC?
    When I use sphitrc it doesn't return anything
    It always returns something. Which of the 4 'forms' of SPHITRC are you using (see built-in help for the 4 forms)? What values?