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

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Rallypoints [RELEASED v1.2, v2.3]
« on: July 20, 2010, 08:25:13 PM »
As pointed out by Annikk, the code in the functions

Code: [Select]
function ScreenDraw()

function OnMouseLeftDownScreen(x,y)

function OnMouseLeftUpScreen(x,y)

function OnAsteroidSelected(id)
   
goes BETWEEN LevelSetup and LevelLogic, not in either of them.



RELEASE v2.3

Added slider following mouse while LMB over slider depressed.
Changed numroids to equal the highest ID of an asteroid in the map. Numroids needs no changing, it is all done automatically.
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.


RELEASE v1.2
Button/checks now relative to the screen, not the world. Should fix problems with Line 89, though might throw up more.
Changed the text at the start.
Added map info at the start of the file.
« Last Edit: February 03, 2011, 01:51:49 AM by Pilchard123 »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Rallypoints
« Reply #1 on: July 20, 2010, 08:27:47 PM »
Sweet !

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.0]
« Reply #2 on: July 21, 2010, 04:48:30 AM »
Here 'tis! I think it's fairly self-explanatory, although I will make a cleaner version of the code if it's wanted. Not only is it a usable code, but it's also a demo level, too, to help you get used to the rallypoints and explain a few things. I suggest you play it, just to get the information out of it. There is no way to win or lose the demo level.

A bit more info that I didn't think to put in is that it will only call seedling from asteroids that YOU own, and will take every single seedling there until you disable rallying, even if they are born/picked afterwards, leaving your asteroids undefended. This is changeable in the code, but after the next patch to the game, I might be able to make it changeable in-game. Maybe.

Any bugs you find, post here, and I'll try to fix them.
« Last Edit: July 22, 2010, 04:58:02 AM by Pilchard123 »

Sniped50

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 97
Re: Rallypoints [RELEASED v1.0]
« Reply #3 on: July 21, 2010, 05:18:30 AM »
Nice. It looks really cool, and, other than the issues you mentioned, it seems to work very well.

Of course, it needs a little tuning. Maybe stop the asteroid menu from closing when you click the box, because it happens to be technically outside the menu area. Or a small slider off to the side to say how many seedlings will be left on the other asteroids for defence. Or the ability to make an asteroid a rallypoint multiple times. Or even something to show that the selected asteroid is currently a rallypoint (like the box being filled), other than the swarm of seedlings surrounding it.

Constructive criticism only, folks.  ;)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.0]
« Reply #4 on: July 21, 2010, 05:25:10 AM »
Maybe stop the asteroid menu from closing when you click the box, because it happens to be technically outside the menu area.
I don't think that's possible.

Or a small slider off to the side to say how many seedlings will be left on the other asteroids for defence.
Next game patch, that's one of the things I'll be doing. For now, there's nothing (practical) I can do.

Or the ability to make an asteroid a rallypoint multiple times.
What, the same one twice in a row?
I think I've got a fix, will try to put it in soon. I'm tired at the moment.

Or multiple rallypoints?
Possible. How is it decided how many to send to each asteroid?


Or even something to show that the selected asteroid is currently a rallypoint (like the box being filled), other than the swarm of seedlings surrounding it.
I think I can do this, too. Soon.

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: Rallypoints [RELEASED v1.0]
« Reply #5 on: July 21, 2010, 06:43:40 PM »
I'd kind of like to get it so that people can make stuff like this that can be layered over the whole game, not just individual levels. same for Annikk.exe's Infected AI, etc. I'll look into it.

Rudolf

  • Administrator
  • Old Oak
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 13
  • Posts: 669
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.0]
« Reply #6 on: July 21, 2010, 06:53:45 PM »
What Alex said. Imagine how cool it would be to have global mods to choose from. :-D

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.1]
« Reply #7 on: July 27, 2010, 09:08:51 AM »
i have a problem when i try to load the demo level.
it comes up with the error message about line 89, trying to call a nil value for the GetCameraZoom.

not sure how to rectify the problem...any help? id like to use it in my upcoming level so im keen to see it in all its glory.

thx.

PS - id like to be more involved in all this grand advancing thats going on these days. this game is just growing and growing and it bodes very well..a hearty congrats to one and all for keeping this game going.

AWS

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #8 on: July 27, 2010, 05:26:24 PM »
Right at the moment, I'm on holiday and have no access to Eufloria. I'm currently using my dsi to type. Are you sure you've patched your game? I think GetCameraZoom() is only in 2.05.

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.1]
« Reply #9 on: July 27, 2010, 09:28:38 PM »
thx for the response.
yeah. i have 205 release version. but i think most people do by now, yes, without any probs?
no worries mate, whenever youve got time and access, keep me posted about what you can see at your end about my problem.

aws

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Rallypoints [RELEASED v1.1]
« Reply #10 on: July 28, 2010, 10:52:09 PM »
Can you post line 89 of the code?  A few lines before and after would be good too :>

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #11 on: July 29, 2010, 12:59:54 AM »
That's what I was going to ask for too.

Check the line that says something like 'scale = GetCameraZoom()', it may be that I forgot the brackets, or something dopey like that.

If that doesn't work, then I have no idea at the moment. I'll be back home at the weekend, so I can be more useful then.

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.1]
« Reply #12 on: July 30, 2010, 10:19:51 PM »
Can you post line 89 of the code?  A few lines before and after would be good too :>

hi guys -
this is lifted, as is, from the code...

function LevelDraw() -- draws box/button for switching rallypoint on or off
   scale = GetCameraZoom()
   xpos = -GetCameraX()
   ypos = -GetCameraY()
   DrawLine(xpos + (300)*scale, ypos + 300*scale, xpos + (350)*scale, ypos + (300)*scale, 0,0,0,0.99,0,0,0,0.99,3*scale) --draws top line of box
   DrawLine(xpos + (300)*scale, ypos + 350*scale, xpos + (350)*scale, ypos + (350)*scale, 0,0,0,0.99,0,0,0,0.99,3*scale) --draws bottom line of box
   DrawLine(xpos + (300)*scale, ypos + 300*scale, xpos + (300)*scale, ypos + (350)*scale, 0,0,0,0.99,0,0,0,0.99,3*scale) --draws left side of box
   DrawLine(xpos + (350)*scale, ypos + 300*scale, xpos + (350)*scale, ypos + (350)*scale, 0,0,0,0.99,0,0,0,0.99,3*scale) --draws right side of box
end


the camera zoom() is line 89.
now, i know sometimes it comes up with messages about a particular line not being finished, which then requires something like another 'end' further down the code. but the error message just says about line 89. anything more than that im not sure.

thanks foir looking. and i wonder why it is that the same code works for some but not others?


Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #13 on: August 02, 2010, 05:46:39 AM »
I have no idea why this isn't working...

It works fine for me, but then I wrote it and tested with my copy. When did you buy Eufloria, and have you used every patch since then?

Alex/Rudolph - Would the v2.05 patch update a v1.0 version and make it perfect (exactly as v2.05 should be?)

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.1]
« Reply #14 on: August 04, 2010, 02:18:02 AM »
I have no idea why this isn't working...

It works fine for me, but then I wrote it and tested with my copy. When did you buy Eufloria, and have you used every patch since then?

Alex/Rudolph - Would the v2.05 patch update a v1.0 version and make it perfect (exactly as v2.05 should be?)

well, all i know is that i got it in its original version and then updated straight to 2.04, then this most recent 'honourifics' 2.05 version. everything has worked without any issues at all.
so, im still at a loss as to why the code doesnt work for me. what does calling the camera zoom do for this rally point code exactly? ie, is it removeable?



Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #15 on: August 04, 2010, 04:46:28 AM »
No, it's not. It's needed to keep the button that toggles rallying in the right place.

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.1]
« Reply #16 on: August 05, 2010, 02:08:43 AM »
hm...then im not sure ill be able to incorporate this rallypoint code into my map just yet. shame.

???

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.1]
« Reply #17 on: September 13, 2010, 02:39:34 AM »
hi pilchard... i dont suppose you have managed to make an updated version of this that i can HOPE AND PRAY will work for me???

id really love to put this code into my maps....


 ???


aws

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #18 on: September 15, 2010, 02:15:52 AM »
No, I haven't. Sorry. Will try sometime, but I've got a lot on my plate right now. Just started college (UK) and stuff.

Rudolf

  • Administrator
  • Old Oak
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 13
  • Posts: 669
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #19 on: September 16, 2010, 01:13:33 AM »
Remember, Alex and I are also looking into something official to get the required gameplay behaviour/UI feature.
(wow, what a vague sentence)

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.1]
« Reply #20 on: September 24, 2010, 06:49:36 AM »
thanks rudolf and pilchard.
cant wait to see this rally point business hard wired into the game code.

aws

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #21 on: September 25, 2010, 10:12:11 PM »
Updates even less likely for the time being. My computer is still dead.

Also, if mods are (semi?)hard-wired into the game, will they still be community editable? While the rallypoint code is fairly simple, and A&R probably understand it better than I do, Annikk's gravity engine and AI are a little more confusing.

Oh, one other thing: how would it work if there were loads of them installed or whatever? I'm imagining another button down the botton that brings up a list of available things to do that aren't planting trees, but I could be going completely in the wrong direction.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #22 on: September 30, 2010, 04:09:17 AM »
Yay, doublepost! Warranted though, it's been a while.

Basically, PC is back up, might get on with some levels and stuff. Might not.

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #23 on: September 30, 2010, 04:52:23 AM »
[..]

Basically, PC is back up, might get on with some levels and stuff. Might not.
Don’t worry, Pilchard123, this is NOT a job ;) nice to see you back!

BTW there's been happening quite a lot around here … maybe you want to check the latest beta, etc., this changes a lot so it may anyway be a good idea to postpone any  work on levels.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #24 on: September 30, 2010, 05:13:50 AM »
I know it's not, but I like to finish what I say I'll start, if possible.

Also, I've been able to read and post (as evidenced by my recent posts) , just on a 2003-build laptop with 2010 AV, and internet on an extension phone line. Updates always come out when I want the net, so you can imagine how much it chews it up. Beta sounds interesting.

Just a side note - is it me or have the forums not been as active recently?

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.1]
« Reply #25 on: September 30, 2010, 05:51:21 AM »
I know it's not, but I like to finish what I say I'll start, if possible.
Very honourable. I only wanted to take away any feeling of pressure, because for those great minds who code the levels we all crave for it may sometimes feel as if all we want is your money body levels ;D

Quote
[..] Beta sounds interesting.
Beta IS interesting :)

Quote
Just a side note - is it me or have the forums not been as active recently?
Nah, communication here has really decreased quite a bit. Must be school/university time after vacations. AWS is offline, too, and Annikk.exe seems to be MIA.

But perhaps we should move the chatter to some [OT] thread?

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.1]
« Reply #26 on: October 01, 2010, 12:49:31 AM »
lol - im still here - just a little, absent of late.
ive just got the 2.06 patch so going to have at it now...
so, does the new version of the game to come use pilchard's rallypoint code, or a different one? would be good to know (for me anyway)

still working on my new map, but with all this rather more substantial and important stuff going, it's some time away. i think ill let the dust settle after this little interim 206 patch.

 ... we continue ...

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2]
« Reply #27 on: December 04, 2010, 11:10:54 PM »
NEW RELEASE.

v1.2
Button/checks now relative to the screen, not the world. Should fix problems with Line 89 (GetCameraZoom()), though might throw up more.
Changed the text at the start.
Added map info at the start of the file.
Download in first post.


Might completely rehash the whole thing soon.


Working on a complete reworking of this stuff. What I plan to do is a follows:

  • Rewrite the code almost from scratch, using snippets from the old version for thing I can't be bothered to type exactly the same.
  • Add a way of indicating whether there is a rallypoint active
  • Add "burst rallying" where only a small (controllable) proportion of the seedlings travel, and only once.
« Last Edit: December 06, 2010, 01:35:06 AM by Pilchard123 »

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2]
« Reply #28 on: December 06, 2010, 02:36:03 AM »
how wondrous!!! ;D

thanks pilchy.. it now works for me.
the black square is nicely old skool and basic... cool in an ugly kinda way!no rounded edges or anything...

in your code notes you mention that each and every roid has to have its own code to be able to qualify as a potential rallypoint...
i have 2 Q's then..

1-in that case, being able to set certain roids and not others as rallypoints, one can presumably enable some seriously involved and complicated choke point/ seedling routing to be done? ie, some roids will and wont be able to rallied to.

and 2-if youve seen the way i code my roids, that is to say long, laborious and not very technical, i list every roid individually. unlike most others i think. call me rubbish, but this may well lead to tediously well-worked routing as i will now have to go through every bloody asteroid and name them, and then repeat for each rallypoint i desire!! ::)

thats how i understand it anyway. perhaps that 'For' loop may come in handy at a later date!

the main thing though is that it now works, at least in your trial level.
so a BIG BIG thank you sir...

:)

aws

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2]
« Reply #29 on: December 09, 2010, 01:31:01 AM »
Okaay...

V2.0 is available - or will be as soon as I upload it. It's possibly not as good/useful as v1.2, but I'll leave that to you to decide. It doesn't constantly send all of your seedling to a asteroind anymore, just a few, and only once.

AWS -

Q1, yes, you can make certain roids un-rallyable.
Q2, it works using the ID of the asteroid, not its name. You don't have to do anything to the asteroid itself.

Upload in first post, keeping v1.2 around still too.

EDIT: Removed LUA commenting marks. Not sure why they were there.
« Last Edit: December 09, 2010, 01:44:14 AM by Pilchard123 »

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.0]
« Reply #30 on: December 19, 2010, 06:22:13 AM »
function ScreenDraw()
   DrawBox(0, 1, 950, 660, 1000, 710, 0, 0, 0, 0.99)

 - can you explain what each one of these numbers is for/ does?

im looking to change the following -
1-colour of the box - EDIT - figured this bit out myself.

2-alter its location on the screen

3-make a circle rather than a box?

and how would i write a percentage value to send, for example, 75% of a roid's seedlings?
« Last Edit: December 19, 2010, 07:08:35 AM by AWS »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Rallypoints [RELEASED v1.2, v2.0]
« Reply #31 on: December 19, 2010, 12:59:01 PM »
To send 75% of seedlings:

Code: [Select]
numtosend = GetAsteroid(insertasteroidhere):GetNumSeedlings(1)
numtosend = numtosend * 0.75
GetAsteroid(insertasteroidhere):SendSeedlingsToTarget(1,numtosend,rallypoint)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.0]
« Reply #32 on: December 19, 2010, 09:00:17 PM »
DrawBox(texture ID, thickness of border, leftedge, topedge, rightedge, bottomedge, rcol, gcol, bcol, alpha)

I don't think circular boxes are possible. I'd be happy to be proven wrong though.

To sent 75% of the seedlings, just drag the slider to 75% of the distance to the left.

I---------------I-----I

Like that.

EDIT: AWS, which version are you using? That up there would work with v2.0.
« Last Edit: December 20, 2010, 09:09:30 PM by Pilchard123 »

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.0]
« Reply #33 on: December 23, 2010, 06:04:59 AM »
ah... ive only just seen your v.2
am pasting it in now along with annikk's V2 AI code!!

EDIT - i see youve changed quite a lot.
so, im going to have go through all my roids again and channge those values again aren't i?! ::)
sobeit... it'll be worth it.

and i think you can draw circles rather than just boxes...
(click to show/hide)

 - whatever that means!

aws
« Last Edit: December 23, 2010, 06:09:50 AM by AWS »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Rallypoints [RELEASED v1.2, v2.0]
« Reply #34 on: December 23, 2010, 08:12:32 AM »
For AWS' benefit, I reviewed all the rally point code just now and I don't see a reason why it wouldn't work fine with Infected AIv2... :>

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.0]
« Reply #35 on: December 23, 2010, 08:59:26 AM »
For AWS' benefit, I reviewed all the rally point code just now and I don't see a reason why it wouldn't work fine with Infected AIv2... :>
hehe...thx annikk
the only thing i can think of that may cause any slowing down is the fact that each roid has to be manually designated.
but thats the only thing and so far i only have 42 roids in the level...
:D

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.0]
« Reply #36 on: December 23, 2010, 09:26:19 AM »
-report just in...
well... theres definitely something going on with this for me.

first - i added annikk's v2 code. that worked fine.
then i added the rallypoint code, then it crashed at exactly the same point as before, just after the 2nd welcome screen.(approx15seconds in)
 ::)

so...for now its a choice of either having the old black box variety of rallypoints, or none at all.
i think for the purposes of trying annikk's new code, ill go without the rallypoints for now.
-end of report!

aws

EDIT - i removed the 2nd part of the rally code, leaving the 1st bit in place- the stuff that draws the box- and it works fine.
so it's something to do with the 2nd part- the long, per-roid edited section...
« Last Edit: December 23, 2010, 09:33:16 AM by AWS »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.0]
« Reply #37 on: December 23, 2010, 04:36:15 PM »
AWS, can you post your LevelLogic code please, with the rallying code all there? I think I might know the problem, but need to check something first.


EDIT: Since in the Infected beta thread you said you didn't like the positioning, I'm going to change it slightly to allow you to move it around easily.
« Last Edit: December 23, 2010, 05:45:40 PM by Pilchard123 »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #38 on: December 23, 2010, 05:46:35 PM »
Uploaded

v2.1
Added easy-to-alter position stuff for the slider and button. While they will stay the same size (unless you feel like changing that too), changing buttontop and button left will move the button around, and bartop and barleft will move the sliderbar around. 0,0 is the top-left of the screen.

EDIT: It's there now, don't know why it wasn't before.
« Last Edit: December 23, 2010, 10:47:50 PM by Pilchard123 »

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #39 on: December 24, 2010, 03:10:58 AM »
i had a thought as i going to sleep last night and then again as i woke this morning (i need help!!) that perhaps it is a case of merely placing the chunk of code in the right order.
i know that if i place the greeting, for example, after the AI code it wont work in game. the level will load but the message wont appear, so perhaps that is something to consider.
also, annikk. requires his AIv2 code to be placed specifically at the end of the first section, which must mean that there are definite reasons for certain placements of code.

perhaps breaking it up in the manner i am currently doing is causing this crash? ill send you my whole code if you like Pilchard, so you can see what im dealing with in here  ;D

ive added v2.1 and will test a couple of ideas first, then report back...

aws

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #40 on: December 24, 2010, 03:23:53 AM »
interesting -
in the function level logic section (what i call the 2nd section!), in this order -

Greeting, Colourwave/ background, Victory trigger, Rallypoint, AI
- the game crashes after the 2nd welcome message that describes how to use the rallypoints. and you have to Ctrl-Alt-Del out of it.

in this order -
Greeting, Rallypoint, Colourwave, Victory trigger, AI -
after you click OK on the 2nd msg box, instead of freezing like above, the message box fades to a lower alpha level, (lighter grey colour, but still visible), and the game slows to neolithic speeds..as if its trying to figure things out one bit at a time.

I think it has something to do with the fact i have to have this code for each and every roid in the map. i currently have 42 roids. this doesnt seem like too many to me, but perhaps from the perspective of having to run this code for every one of them, it causes too much of a lag, or freezes?

in any case, id prefer to send you all my code via PM if i can, so you can tell me what elementary mistake im making. :D

aws

 PM me when you can so i can send this to you. (dont want to post everything i have on here)
« Last Edit: December 24, 2010, 03:30:08 AM by AWS »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #41 on: December 24, 2010, 07:03:20 PM »
Just take out the message, see if that helps. (I have PM'd you with another idea)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #42 on: December 24, 2010, 09:41:19 PM »
Okay...

I think it works now. v2.2 being uploaded ASAP.

v2.2
Made it work.
Replaced loooooooooooooong hardcoded section with softcoded for loop (finally!). Requires a variable numroids, equal to the total number of asteroids (not the highest ID) in your map.

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #43 on: December 25, 2010, 01:38:30 AM »
replaced with v2.2
(removed text!)
where should this numroid varible be placed, though? and how should it be written?


Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #44 on: December 25, 2010, 02:42:11 AM »
It's at the end of the LevelSetup() section, already there. All you have to do is change it to whatever your level needs it to be.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #45 on: December 27, 2010, 08: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: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.2]
« Reply #46 on: December 27, 2010, 07:04:22 PM »
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 28, 2010, 03:41:41 AM by Pilchard123 »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.1]
« Reply #47 on: December 28, 2010, 04:04:59 AM »
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, 11:22:35 PM by Pilchard123 »

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #48 on: December 31, 2010, 05:24:27 AM »
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: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #49 on: December 31, 2010, 05:03:28 PM »
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: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #50 on: January 01, 2011, 06:39:26 AM »
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, 10:17:18 AM by AWS »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #51 on: January 01, 2011, 05:39:29 PM »
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: 4
  • Posts: 1,809
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #52 on: January 01, 2011, 09: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: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #53 on: January 01, 2011, 11: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: 4
  • Posts: 1,809
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #54 on: January 02, 2011, 06:19:40 AM »
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: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #55 on: February 03, 2011, 01:33:31 AM »
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: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #56 on: February 03, 2011, 01:36:36 AM »
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: 2
  • Posts: 275
Re: Rallypoints [RELEASED v1.2, v2.3]
« Reply #57 on: February 03, 2011, 01:53:28 AM »
possibly. not entirely sure though. 2.3 it is...