Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
is making an rts in alice 2 possible?
Old
oll
Junior Member
 
Status: Offline
Posts: 4
Join Date: Feb 2015
Question is making an rts in alice 2 possible? - 04-05-2015, 11:51 AM

im kind of new to the whole programming thing, but alice has been fairly simple so far. i've been pondering, however, how i would go about making an rts style game in alice (like starcraft, c&c). i attempted to make one, but ran into a really confusing issue.

there doesn't seem to be a way for alice to store the mouse's location on the fly, unless im just looking at this incorrectly. i can get alice to track the mouses location (i used this to create an edge panning sort of deal), but im lost as to how i could store it when i want to, say, move a unit to the location of where i clicked. is there any way to do this? it's absolutely essential for an rts in this style, and without it things crumble and fall over.

also is it possible for alice to use right mouse in the events pane for controls? it only seems to use left mouse.
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 409
Join Date: Oct 2013
Location: Northern Virginia
Default 04-05-2015, 12:01 PM

My only suggestion on how to do this is use a grid of invisible squares and store the square clicked on.

I did this before on a RPG, but i got that annoying error when loading and i gave up.

For the squares arty made an object pack and there is a 25/25 grid in there.

Hope this helps and if you have any questions please ask.


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
oll
Junior Member
 
Status: Offline
Posts: 4
Join Date: Feb 2015
Unhappy 04-05-2015, 12:09 PM

that's really disappointing that i have to do that

there has to be some way to get alice to do this, because it clearly has no issue keeping track of the mouses location.
   
Reply With Quote
Could be Simple
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Smile Could be Simple - 04-05-2015, 03:53 PM

1) In the events pane, you can add a "when mouse is clicked on something" event. It will say "do nothing"
2) Create a new method, and add an object parameter.
3) Go back to the event, and replace "do nothing" with the name of your method and then add "What was clicked" as the parameter.
4) You now have a method that can be programmed to do whatever you want anytime an object is clicked by Using customized lists and arrays.

Happy Programming

Last edited by MrMoke; 04-09-2015 at 08:24 AM.
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 409
Join Date: Oct 2013
Location: Northern Virginia
Default 04-06-2015, 07:07 AM

Quote:
Originally Posted by oll View Post
that's really disappointing that i have to do that

there has to be some way to get alice to do this, because it clearly has no issue keeping track of the mouses location.
What do you mean track of the mouses location?


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
oll
Junior Member
 
Status: Offline
Posts: 4
Join Date: Feb 2015
Default 04-06-2015, 09:54 AM

there was a function that kept track of the cursors distance from the top and left edge (i think, i don't have alice on me currently), and having it constantly print out the function resulted in something similar to (x,y) coords
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 409
Join Date: Oct 2013
Location: Northern Virginia
Default 04-06-2015, 12:26 PM

That could be possible, use the x,y cords then move the objects to those cords.

Good idea, and i think it is possible, ill see if i can make that.


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
fourbros
Senior Member
 
fourbros's Avatar
 
Status: Offline
Posts: 476
Join Date: Nov 2011
Location: Right Behind You...
Default 04-06-2015, 12:35 PM

I don't want to sound like Mr. Negativity, but making an RTS sounds almost impossible. It's taking me a long time to make a simple, bare-bones sports game. I couldn't fathom creating something like Starcraft.

But hey, if you are able to, then I'll eat my words


My avatar is from the anime "Hyouka".......

You've probably never seen it, much less heard of it.....

You should watch it........


print("Hello World")
This is python code.

Lakers > Clippers
Vikings > Packers
Cardinals > Brewers/Pirates/Cubs/Reds
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 409
Join Date: Oct 2013
Location: Northern Virginia
Default 04-06-2015, 12:39 PM

Ok, i fooled around with this for a few mins, and heres what i came up with,
and it worked for me so far.

It might need some tweaking depending on the height of the camera.

EDIT: added a better working version, much more accurate
Attached Files
File Type: a2w RTS mouse movement IMPROVED.a2w (192.9 KB, 10 views)


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game

Last edited by RavenOfCode; 04-06-2015 at 12:59 PM.
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 409
Join Date: Oct 2013
Location: Northern Virginia
Default 04-06-2015, 12:56 PM

Quote:
Originally Posted by fourbros View Post
I don't want to sound like Mr. Negativity, but making an RTS sounds almost impossible. It's taking me a long time to make a simple, bare-bones sports game. I couldn't fathom creating something like Starcraft.

But hey, if you are able to, then I'll eat my words
I find sports games the hardest... i guess everyone has whats hard for them.


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Reply

Tags
alice2, question, rts

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.