Author Topic: Rallypoints [RELEASED v1.2, v2.3]  (Read 6189 times)

0 Members and 1 Guest are viewing this topic.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #45 on: December 27, 2010, 12:08:38 AM »
Requires a variable numroids, equal to the total number of asteroids (not the highest ID) in your map.

It's possible to calculate that automatically so that the person implementing it does not need to change anything.  :>

Have a look at this code:


Code: [Select]
numroids = -1

for i = 0, 200 do
if GetAsteroid(i) ~= nil then
if GetAsteroid(i).radius > 10 then
numroids = numroids + 1
end
end
end

-- now the variable called "numroids" accurately represents the number of playable asteroids on the field.

If there is one asteroid in the level, you will get a numroids variable that is equal to 0.  I find this convenient because it corresponds to Asteroid ID 0.
So if you have the following asteroids in the level:

Asteroid 0
Asteroid 1
Asteroid 2
Asteroid 3

Then this code will automatically detect "numroids" to be equal to 3.
Then when you refer to them later in your "For" loops, you can just be all like:

for i = 0,numroids do

And it will do it all perfectly for you.  :>



The code doesn't include asteroids that have a radius lower than 10 as being actual asteroids.  This is because those asteroids would not be playable anyway - seedlings would never be able to orbit them, the player would be unable to click on them, etc.  Why would anyone put an asteroid that small into a map, you ask?  Well, you might make a 0 radius asteroid at coords (20000,20000) to act as a spacer, to increase the size of the quad tree in (for example) a level with moving asteroids, so they have loads of space to move around in.  :>

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.2]
« Reply #46 on: December 27, 2010, 11:04:22 AM »
Hm. I might add that in sometime. Next update probably.

EDIT: That's all very well, but if you make a spacer roid then another playable roid, it messes it up. That's avoidable, but I've taken out the radius check to play safe.
« Last Edit: December 27, 2010, 07:41:41 PM by Pilchard123 »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #47 on: December 27, 2010, 08:04:59 PM »
RELEASE v2.3

Added slider following mouse while mouse depressed.
Changed numroids to equal the highest ID of an asteroid in the map.
Added dynamic calculation of numroids at the start of the map, and instructions on how to have it happen every cycle, if there are asteroids being created/destroyed.

EDIT: DON'T mess with numroids. It needs nothing doing to it, unless you create/destroy 'roids at runtime, and instructions are included in the file.
« Last Edit: December 28, 2010, 03:22:35 PM by Pilchard123 »

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #48 on: December 30, 2010, 09:24:27 PM »
added latest version with numroids etc.
im having a problem..
i click on the roid, select percentage/max then click grey box, at which point it acts as a deselect, rather than recognising the box's presence.
eg, if i click the box over a roid (so i can see it!) it selects the roid behind it, not the box itself.

im sure theres a simple reason for this?



Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #49 on: December 31, 2010, 09:03:28 AM »
Yup. It's not really a button.

Because I drew it in ScreenDraw, it has no speacial behaviour, so I all it does is check to see if you click inside it.

There is no way of stopping that happening until A&R let use get at the UI. (DOOOOOOOO IIIIIIIIIITTTTT!)

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #50 on: December 31, 2010, 10:39:26 PM »
if its not really a button, how does the code work then?

the instructions are to click a roid, select a %, then click grey box to set it.
but the grey box bit doesnt work. so how does the code work?!
 ::)

OK - so,
i had this thought while trying to get this thing to work -
would it not be a better rallying procedure to be able to click on a roid youre sending FROM (either left or right click like it is already), then right click on the roid you want to send TO, (at the moment you left click to send all). the right click would be the rallying code itself, and thus need no further code. this action would then send however many seeds you chose in your first mouse click (individual left clicking or click and hold and drag for all seeds, or in this case, add a right click drag option) on a continual basis OR as a one time event.
this makes SO much more sense, and is a cleaner way of doing it. not to mention you wouldnt need any screen clutter like the slider bar at the moment.

ie, once you chose 2 roids' relationship with regard to rallying the seeds, that relationship would exist for the duration of the game OR only once; perhaps an option one can select from a drop-down mini-menu upon right clicking on the send TO roid.

-so, to do it, you would right click on roid A, drag to roid B, right click again and a dropdown menu appears, allowing you to set % to send and whether its a continuous or 1 time event, then left click your chosen option. bang. rallypoint is now set.

this would then allow multiple roid relations and once set, wouldnt require any further action/ input from the player unless desired.

so, if for example, you have 26 roids in the level, A-Z, you can set up multiple rally relationships like so,
A sends 80% of its seeds to B (continuous throughout game)
B sends 50% to C (one time only)
C 100% to D (always)
E - F (once)
G - H
etc etc...

this would allow FAR greater strategic functionality. and if you're worried about keeping track of which roid is sending to which other roid. perhaps a small tiny pixel line can be drawn to show its 'orders', an option that the player can toggle on/off.

this might sound like a large undertaking, but it seems to make the best and cleanest sense with this rallying business.

what say you, sir? do you have the minerals  ;)

aws
« Last Edit: January 01, 2011, 02:17:18 AM by AWS »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #51 on: January 01, 2011, 09:39:29 AM »
Oh, I have the minerals.

There's a few problem that just can't be overcome, though, the biggest two being that there is no way of detecting a right click and that you can't make menus until A&R let us, which won't be for some time.

The multiple route thing could work though.

As it is now, the button and bar are only visual aids. It would work even it they weren't drawn. In the mouse button functions, it just reports if there was a click in the area displayed by the box or bar, then acts accordingly.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #52 on: January 01, 2011, 01:10:42 PM »
Hmm.  Can you make a button that auto-hides when the cursor isn't nearby?
(I have no idea if it's possible.  Just throwing around ideas)

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #53 on: January 01, 2011, 03:14:17 PM »
ok, so until they let us make menus and many other things we need an alternative.
an alternative to the right click detection i dont know. i was under the impression left click is programmable, (eg, in your current rally code.) so i wonder why not right click?
the dropdown menu sounds more easily sorted. as per annikk's auto-hide possibility. maybe.

is it not possible to ask alex to open up a few necessary options to allow things like this, in a case by case basis, approved by him explicitly, or is it a case of a blanket yes or no? not too sure about that side of things. is it a decision based on legal stuff or something?


annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #54 on: January 01, 2011, 10:19:40 PM »
From what I've seen, it should be totally possible to make just about any UI feature mentioned in this thread with existing commands.

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #55 on: February 02, 2011, 05:33:31 PM »
lol
where are we with this?
ive got down on my Custom Levels thread that you're up to v2.4. but i only see 2.3 available for download.

whats the deal yo?!
:D

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #56 on: February 02, 2011, 05:36:36 PM »
v2.3 is the latest. Why did you think v2.4 was? Did I upload something for a only a short time, or something?

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #57 on: February 02, 2011, 05:53:28 PM »
possibly. not entirely sure though. 2.3 it is...