Random Mission Area Position Generator
Just a neat function I made that I feel can be pretty useful.
[code]
//Mission Area == MissionArea.getArea() = (X, Y, W, H) Origin Corner->|\ | EXAMPLE DIAGRAM
//X -> coordinate for origin corner | \ |
//Y -> coordinate for origin corner | \ |
//W -> width or X axis expansion from origin corner | \ |
//H -> height or Y axis expansion from origin corner | \|
[code]
//Mission Area == MissionArea.getArea() = (X, Y, W, H) Origin Corner->|\ | EXAMPLE DIAGRAM
//X -> coordinate for origin corner | \ |
//Y -> coordinate for origin corner | \ |
//W -> width or X axis expansion from origin corner | \ |
//H -> height or Y axis expansion from origin corner | \|
Comments
Couple questions...
Yes, actually, when you look in mission editor/mission area editor the game actually flips the north south directions on the pop-up hud (or whatever you want to call that). So, instead of the normal grid pattern
( - + ) ( + + )
( - - ) ( + - )
it's
( - - ) ( + - )
( - + ) ( + + )
###########
Therefore the need for the H to be subtracted from Y.
The second question: Why do I link the blank text at the ends? Habit, I guess. I've gotten used to doing "Some text that incorporates "@%SomeKindOfVariable@" here."
So yeah, you can get rid of those ""@ / @"" from the code.
- While it is true that the Mission Area Editor shows the missions area upside down, it does not actually contribute to the North and South positions being screwed up in a way to need H subtracted from Y. My previous results from testing were, so to say, false positives. My test mission area (0, 0, 1000, -1000) seemed to show that the numbers would never reach outside the mission area.
- What I should have done is to test all the different types of mission areas (-,-,-,-; +,+,+,+; etc...) to be sure. I've since done this (16 total types) and have found no problems with the RMPG function.
Thanks to Red Shifter for making me re-check my function.Here's The Way I Tested It, Just Skip This If You Don't Care :P