Jump to content


Photo

RTS resource


  • Please log in to reply
5 replies to this topic

#1 anerror

anerror

    GMC Member

  • GMC Member
  • 11 posts
  • Version:GM8

Posted 22 June 2012 - 06:21 AM

hey there I am starting to create a RTS game, like Starcraft. But the snag that is buging me is the resources. if you look at Starcraft the harvesting units go to the mineral cluster and the returns but one unit at a time. I am not sure how to get the one unit at a time. part 2, the fuel; the unit is destroyed when it comes collides with the fuel building, then is recreated when it is done gathering the fuel. the problem with this is that when the the unit is recreated the var that i have in place so that it returns to the bas and the var for saying it is full and can't gather any more are not doing their job for going back to the base and saying it is full.

here is the file: RTS_file


thanks
Anerror
  • 0

#2 eyeCube

eyeCube

    GMC Member

  • GMC Member
  • 206 posts

Posted 22 June 2012 - 06:26 AM

You posted this topic thrice.

EDIT:
you should use a variable for whether the unit is carrying an object.
You could use a variable for how many resources are available in the resource as well.
Notice I said "a" variable. You could do it with only one.

Edited by eyeCube, 22 June 2012 - 06:29 AM.

  • 0

#3 anerror

anerror

    GMC Member

  • GMC Member
  • 11 posts
  • Version:GM8

Posted 22 June 2012 - 06:29 AM

You posted this topic thrice.


I know i was didn't know until i look at the board because i was getting an error [#103128] and i have no clue how to delect the other two
  • 0

#4 eyeCube

eyeCube

    GMC Member

  • GMC Member
  • 206 posts

Posted 22 June 2012 - 06:30 AM


You posted this topic thrice.


I know i was didn't know until i look at the board because i was getting an error [#103128] and i have no clue how to delect the other two



Ah. Don't worry, a moderator will delete them for you and should realize it was only an accident.

EDIT: I edited my first post here with a little info that could come in handy. I'm sorry but I haven't got time to look at your GM file.

Edited by eyeCube, 22 June 2012 - 06:31 AM.

  • 0

#5 Mr B

Mr B

    GMC Member

  • GMC Member
  • 172 posts

Posted 22 June 2012 - 06:36 AM

For your first problem you can use alarms or you can make var_resource increase a bit each step and then use floor(var_resource) when the unit delivers the resources.

The second problem:
Make the fuel building remember the units id and then deactivate it:
instance_deactivate_object(iii)
and then activate it again later.
  • 0

#6 anerror

anerror

    GMC Member

  • GMC Member
  • 11 posts
  • Version:GM8

Posted 22 June 2012 - 06:36 AM



You posted this topic thrice.


I know i was didn't know until i look at the board because i was getting an error [#103128] and i have no clue how to delect the other two



Ah. Don't worry, a moderator will delete them for you and should realize it was only an accident.

EDIT: I edited my first post here with a little info that could come in handy. I'm sorry but I haven't got time to look at your GM file.


no problem look at it when you have time no rush
with the deactivate it deactivates the objects with that name and there are more then one of them in the room at the time

Edited by anerror, 22 June 2012 - 06:43 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users