Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Range from event script (question)

Hi ppl,
i searched and cannot find a script that would suit my needs.
I need a script for a event, it recognises a range the player is from the event and when close enough it starts battle. Kind of like a conditional branch (is player 3 squares from event?, if not Exit event processing) If 2 squares from event show animation)

That king of thing.,

Any susgesstions??

Thanks
 
I'm not sure about scripting, but there's a way to event it.

Step 1: Establish Event's X and Y

set var 0 = Event X (vEventX)
set var 1 = Event Y (vEventY)


Step 2: Establish the Range (in this case 3)

set var 2 = vEventX+3 (vEventX-Hi)
set var 3 = vEventX-3 (vEventX-Low)
set var 4 = vEventY+3 (vEventY-Hi)
set var 5 = vEventY-3 (vEventY-Low)

Step 3: Establish Hero X and Y

set var 6 = Hero X (HX)
set var 7 = Hero Y (HX)

Step 4: Conditional Triggers

if HX >= vEventX-Lo
if HX <= vEventX-Hi

And so on and so on, do you get the picture?
Basically you establish a square and check to see if the hero is in that square.
Even more simply, you establish a range of numbers and see if the hero's x and y are in that range.

I'm sure you can find the script that makes what I've just written useless though...
 
Umm.... I'm not too good with variables yet. I assume the method suggested above will work but i'm not that good to understand where and how everything goes together.
Sorry
 
does anyone else have any suggestions or know how to make a range distance from a event. Doing it the Event commads way seems very painfull.

I think a script would work best.
 
The script is good, however it only allows you to turn ON self switchs on a event, not turn them On or Off, or even allow you to turn on a control switch on or off. It also has a memory, so that when the script is not turned on but you walk within range of the event, and go away and turn the script on. It already thinks that u are within its range, but you currently are not. But because you HAVE been while the script was off it thinks you are.
LOL this is a good attempt but still needs alot of work.

Thank you for your help, however i think i will just have to go about doing what i need to do in another way.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top