• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

gold and lumber questions

Status
Not open for further replies.
gold and lumber questions "PLEASE CAN SOMEONE HELP ME"

How to save gold and lumber with cache?
How to add maybe in a shop item or ability to create ancient gold with 1,000,000 gold or with the same way lumber?
How to save the ancient gold with game cache or with the same way lumber?

Can you guys please help me!?
I will need this soon for a rpg map so please HELP ME!
 
Last edited by a moderator:
Level 23
Joined
Apr 16, 2012
Messages
4,041
create a gamecache variable, then you can use

JASS:
call StoreInteger(mygamecache, "missionkey", "id", GetPlayerState(PLAYER_STATE_RESOURCE_GOLD))
call StoreInteger(mygamecache, "missionkey", "id2", GetPlayerState(PLAYER_STATE_RESOURCE_LUMBER))

it depends on how you want to represent the ancient gold. If you want the simplest approach, you can just store it inside variable(number of ancient golds player has) and then save it the same way as above.

In the shop you can sell unit which is called Ancient gold, and then in your map script, you will basically check for units that enter playable map area, and if it is Ancient gold, add to player. The same can be done if he wants to sell it
 
create a gamecache variable, then you can use

JASS:
call StoreInteger(mygamecache, "missionkey", "id", GetPlayerState(PLAYER_STATE_RESOURCE_GOLD))
call StoreInteger(mygamecache, "missionkey", "id2", GetPlayerState(PLAYER_STATE_RESOURCE_LUMBER))

it depends on how you want to represent the ancient gold. If you want the simplest approach, you can just store it inside variable(number of ancient golds player has) and then save it the same way as above.

In the shop you can sell unit which is called Ancient gold, and then in your map script, you will basically check for units that enter playable map area, and if it is Ancient gold, add to player. The same can be done if he wants to sell it
Thank edo you are my sensei !^^
 
Status
Not open for further replies.
Top