Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: matias on November 04, 2011, 08:41:00 AM

Title: Help needed with RTS like Unit Selection and Movement. [SOLVED]
Post by: matias on November 04, 2011, 08:41:00 AM
Hello everyone, about a month ago I'm with couple of friends bot a Playmaker and we are trying to create a little 2D strategy game for IOS with mechanics similar to Battleheart from Mika mobile or Trenches. So I need to create characters selection and movement functionality.
I was looking through forums and a lot of people sugesting to use MousePick action for that kind of stuff, it works for movement but It seems that action only move preset object and dosent have any functionality to select diffrent objects(characters). Or did I missed something? :)
Title: Re: Help needed with RTS like Unit Selection and Movement.
Post by: Alex Chouls on November 05, 2011, 02:18:47 PM
This is quite a big problem, and would require a working example to fully explain, but here are some pointers:


You will probably also need some collection to keep track of selected units. There are a few ways to do this in Playmaker:


You can then iterate through this collection when needed...

Hope this helps some! Will try to get some basic RTS samples into the next update.
Title: Re: Help needed with RTS like Unit Selection and Movement.
Post by: Andrew.Lukasik on November 05, 2011, 02:35:51 PM
To handle selection I would try to do this with Screen Pick instead MousePick.

If you want to have region selection I would start with reading mouse XY on touch/button start and end (this will give you selection region precisely). Then make series of raycasts with Screen Pick in this region to search for units available to select
Title: Re: Help needed with RTS like Unit Selection and Movement.
Post by: matias on November 07, 2011, 10:12:15 AM
Tnx a lot, will try it out today.  Also our game doesn't have any kind of group selection, player can pick and control only one character a time. :)
Title: Re: Help needed with RTS like Unit Selection and Movement. [SOLVED]
Post by: jeanfabre on March 21, 2013, 02:26:41 AM
Hi,

 On the same kind of topic, I also created a working RTS selection system, that might come handy in your game. It's in the sample of arrayMaker package.

https://hutonggames.fogbugz.com/default.asp?W715

bye,

 Jean