Making sell system ;o

Status
Not open for further replies.
Level 7
Joined
Aug 31, 2011
Messages
125
Im trying to make a sell system, i can make one very easily using the point values in object editor, then giving the player the gold, but i want to make it so it only gives you 75% of the gold given. I do not want to calculate the price to 75% (ex: 1 building cost 100g, i do not want to do 100gold-25% of a hundred, (this can be done through calculator program) just to find 75% of what the unit is worth.), i just want to do it simply in GUI, so i dont have to change 100 units point values, and calculating them x_x. It just takes too long, but if this is the only way, i don't mind i guess, i just want to know if it can be done in GUI.
+rep will be given ofc. (unless i just gave you rep :P)
 
Nestharus has a GetUnitCost system in the Jass section. :P

If that doesn't help, you could just write:
native GetUnitGoldCost takes integer unitid returns integer
native GetUnitWoodCost takes integer unitid returns integer

In the map header.

Then, in a custom script:

set udg_buildingCost = GetUnitGoldCost(GetUnitTypeId(udg_YOUR_UNIT))

Then you would use the GUI variable buildingCost.

Enjoy.
 
Why, yes.
I think it does.

The only other ways that don't require JNGP:
- A system that sets the gold of Player 13 to 1000000, creates a builder, orders him to build in a certain position on the map, and finds the cost by subtracting the the current gold of player 13 from the 1000000.
- Caching all unit prices in a hashtable (which is terrible)
 
Why, yes.
I think it does.

The only other ways that don't require JNGP:
- A system that sets the gold of Player 13 to 1000000, creates a builder, orders him to build in a certain position on the map, and finds the cost by subtracting the the current gold of player 13 from the 1000000.
- Caching all unit prices in a hashtable (which is terrible)

Is there a way to get item cost?
 
Status
Not open for further replies.
Back
Top