• 🏆 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 to wood exchange

Status
Not open for further replies.
Level 6
Joined
May 7, 2009
Messages
228
Is there any way to make a spell to exchange, say, 500 gold for 100 wood, without using triggers?

I thought I might be able to do it with Charge Gold and Lumber, but it won't let me put in a negative value for the wood cost.
 
Level 7
Joined
Mar 26, 2009
Messages
345
You could make the "Bundle of Wood" item available for purchase at a store..

But, really, triggers would allow you to be much more flexible.
 
Level 6
Joined
May 7, 2009
Messages
228
I already have a chat command to buy wood in any amount

The spell was supposed to just be a quick addition for people who don't know about the chat command or for people who are sharing control due to a leaver.

I know I could modify the chat command to allow you to buy for a player other then yourself, but I didn't really feel like it and besides, having to put two separate arguments after the command is already a bit complicated.
 
Level 9
Joined
May 10, 2009
Messages
542
I might be able to do it. Leme make a quick test map.
EDIT: Nope, the gold receive is not a Real value, its an integer - so you cant negative it.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Just to clear things up:

A description is very important!
If you didn't say that there is such a command in the description, nobody will know about it...
Try attracting as much people as possible to read the description...

If you want a negative value:
Shift + Enter on the data where you want a negative value, then you can use negative values.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Well, it's probably an integer...
Unless your gold/lumber is a real integer, which would be a... surprising fact, to say at least.

Warning:
The Shift + Enter-combination works for almost all integers, but this may result in unwanted behaviour of the map.

I have recently tested over 200 possible functions of the shift+enter-combination, 4 of those have crashed the map instantly, another 2 have increased the loading time so a 32x32 map would take as long to load as one of the biggest maps I have ever played.
Other negative values, or values out of range may not function properly in-game.

Only use it when there is no other (easy) option, since Blizzard didn't set these boundaries for no reason.
 
Level 6
Joined
May 7, 2009
Messages
228
Ok I tried the Shift+Enter thing and it worked great. My map hasn't crashed yet, so I guess this topic can be moved to [Solved].
 
Status
Not open for further replies.
Top