Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
buying system

presidentg
Registered User
Quote
2023-06-11 05:52:04

Im creating an rts game and so far its going pretty smooth, however im beginning to work on variables and I am curious to know how to create a system where you can use points and buy units (rts player ai) and if you dont have enough points it will not let you buy it. Thanks!


sven
Registered User
Quote
2023-06-11 09:48:48

Var points=1000;

Menuitem: buy soldier

IF klicked AND points > soldier_price
Make soldier
Points=points-soldier_price
ELSE
Print you dont have money
ENDIF


For AI there is no menuitem so periodically let him call buy loop to buy stuff..


Monks
Guest
Quote
2023-06-11 15:42:41

Hi sven can u pls elaborate the buying system implementation for us


sven
Registered User
Quote
2023-06-11 17:53:52

Sure -not much to talk about it..its kinda simple so this example will show how to make it happen.

Download:
https://drive.google.com/file/d/...

Simple example where you can buy soldier and tank units.

Klick on house (its barracks produces soldiers)
klick on closet (its tankFactory produces tanks (cars in this example) )

You see menu is the 2doverlays..you can extend it..just add more unit types and add menuitems.


If this example was not what you meant then be more specific and i try to give better example.


edwin123
Registered User
Quote
2023-06-11 18:39:58




Monks
Guest
Quote
2023-06-11 20:32:39

Thanks sven, for your assistance and time


presidentg
Registered User
Quote
2023-06-12 03:26:41

Thanks it works very well!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact