RTS Buildings (Static + up)

Get help using Construct 2

Post » Tue Jul 12, 2016 5:33 pm

Hey everybody! I'm so glad I can be a part of C2. (Best invested money ever :D)

Well, now I work on a RTS game, but I'd like to work with Static buildings with uppgrade possibilities. Unfortunatuly, I'm quite new to this, but I know already few things. Maybe its bull5&!7, but I create Menu (Bckground with buttons), Global Numbers (Gold, Lumber - every kid can do that, I know) and now I am lost :D You can take a look on screens What I provide ou here.

Yes, yes... Tutorials, guide books.... I read a lot of that, but my eyes hurts right now, thats why I'm writes here. If someone have an idea, write me.

Good rest of a day guys!!!

Sputnik.

    Image

    Image

PS: I dont want from anyone to do my job, just looking for some kick into my butt. :)
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Post » Tue Jul 12, 2016 6:58 pm

Soooo.... What's the question exactly? :D

Sorry, I'm not sure I understand what you need help with.
B
54
S
24
G
18
Posts: 295
Reputation: 13,140

Post » Tue Jul 12, 2016 7:22 pm

To create an object (Building - Using those 3 squares) as a static buildings with upgrade possibility and generating resources. Because all of the guides what I read before was for direct manipulation with Sprites and now I stuck.
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Post » Tue Jul 12, 2016 8:09 pm

Well, a quick and dirty way you can do it is by using sprite animations.

e.g. For every free spot on the hill where you can build, place a sprite which is either set to invisible or has a clear animation so you can't see it. Each sprite also has other animations of different buildings which aren't shown at start. Now set conditions like,

If player selects sprite
+ player clicks pink button
+ sprite is clear
+ Gold > 100
--> set sprite animation to "Barracks" + Subtract 100 from gold
(So if we select a clear sprite and click the "build barracks" button, and have enough gold, we build a barracks)

If player selects sprite
+ player clicks blue button
+ sprite animation is "Barracks"
+ Gold > 200
+ Lumber > 100
--> set sprite animation to "BarracksUpgrade1" + subtract 200 from gold + subtract 100 from lumber
(So if we select a "barracks" sprite and click the upgrade button, and we have enough resources, we upgrade the barracks)

For resource generation, you can use variables like e.g. give Barracks a variable Money and do something like this:

Variable Money>0 --> subtract 1 from Money (you can also use delta time)
Variable Money=0 --> set Money to 100 + Add 5 to gold
(This means each barracks will generate 5 gold every short interval)

Anyway, that's one way to do it. Probably could use some finesse and tuning to suit your needs as they come up.
B
54
S
24
G
18
Posts: 295
Reputation: 13,140

Post » Tue Jul 12, 2016 9:05 pm

I still trying to figure it out by myself, but what you wrote is great. Now I'm trying to make something like Idle Clicker for Web browser (Think its easier for me). But that level system is realy hard :D You can take a look what I made so far. Now I'm trying to beat my brain cells whose telling me to go to bed and sleep :D

As you can see (If you can see) those red L's on two squares, that means LOCKED. So I need to creat a condition to NOT generate money and lumber till its unlocked with 5 levels of first building and a lot of money/lumber.

Image

Image

Image
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Post » Tue Jul 12, 2016 9:27 pm

Just add another variable and use it as a condition for resource generation, like e.g.

Variable Money>0 + Variable Level>5 --> subtract 1 from Money

This is will prevent Money cooldown from reducing unless Level is greater than 5. You can then modify Level each time you upgrade a building.
B
54
S
24
G
18
Posts: 295
Reputation: 13,140

Post » Tue Jul 12, 2016 9:33 pm

Cheers SputnikCZ,

as far as I understood, you want to give the player money and lumber as soon as they unlock the building - not before? The simplest way, which comes in my mind, declare a local bool (or a variable is also possible):

if amout of buildings < 0 then
activate group "produce"
else
deactivate group "produce"

... or in a picture:

Image
(this should have minimal impact on cpu, because you are not checking something on "every second")

Hopefully, thats what you needed to know :D (getting tired...).

Best regards
Proxy
B
24
S
15
G
9
Posts: 118
Reputation: 6,864

Post » Tue Jul 12, 2016 10:02 pm

Cheers Proxy!

Ah, I'm new in this (Whole programing) but I learn quickly :D I will take a look on this ASAP. In other you can take a look into my capx. But dont send me anything :D I have to do it by myself :D Just advices. :D I did so far progress as this one - Other buildings are locked (Except the last one - House with people), generating only 3G and L from 5G and L - -2 are for people. But I cant upgrade my produce building right now :D So I have next few hours to solve this unexpected problem. :D

GDrive

There is my capx. :)
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Post » Tue Jul 12, 2016 10:12 pm

SputnikCZ wrote:Cheers Proxy!

Ah, I'm new in this (Whole programing) but I learn quickly :D I will take a look on this ASAP. In other you can take a look into my capx. But dont send me anything :D I have to do it by myself :D Just advices. :D I did so far progress as this one - Other buildings are locked (Except the last one - House with people), generating only 3G and L from 5G and L - -2 are for people. But I cant upgrade my produce building right now :D So I have next few hours to solve this unexpected problem. :D

GDrive

There is my capx. :)


Hi again,

no problem :D everyone started somewhen ;) .
If you got answers you can write me a pm, if Im only and see it, ill write back ;P

Cheers
Proxy
B
24
S
15
G
9
Posts: 118
Reputation: 6,864

Post » Fri Jul 15, 2016 3:46 pm

If you are a quick learner, willing to work hard, and willing to learn Java, we will grab you for our project. You would also be required to sign a non-disclosure agreement, which requires that you be of legal consent age or your parents must sign it on your behalf.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests