• 🏆 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!

New Resources - Woot another problem!

Status
Not open for further replies.
Here is the deal, in my map Shadow Tactics, you can mine Iron Ore from Iron Deposits by attacking them with miners. It slowly adds to a variable called P(player number)IronOre.

When you build a blacksmith, it slowly adds Equipment to the P(Player number)Equip variable and removes iron ore from the P(player number)IronOre variable.

So every 2 seconds it does a small -10 in bright grey, and +1 in Dark Grey above your blacksmith. Meaning it removes 10 iron ore and adds one equipment.

Equipment is used to hire units. Well the thing is, I need to make a trigger that...

----------------------------------
When Player owns Blacksmith

P(#)IronOre > or = 10

Every 2 seconds create floating text above blacksmith -10 (light grey) +1 (Dark Grey)
set P(#)IronOre = P(#)IronOre - 10
set P(#)Equip = P(#)Equip + 1
----------------------------------
When Player owns Blacksmith

P(#)IronOre < 10

Every 2 seconds create floating text above blacksmith 0 (light grey) 0 (dark grey)
----------------------------------


But its madness! I'd have to make a trigger for creating equip for each player, and another for mining, and another for multiple blacksmiths!

Thats...
10 x 10 x 10 = 1000
Even with the help of coffee I'd be sitting here awhile.

Please help, Im about to go sepuku over this damn plan. It seems so perfect in my head, but when I hit the triggers, its a nightmare, I'm probably gonna lose sleep over this one lol.
 
Stop insulting my math skills... lol

I just wanna know how I can cut down from 30 triggers.

Actually more of how the hell I could do the blacksmith/multiple blacksmiths thing...

The mining Iron ore is kinda confusing too actually...

Unit is damaged

Unit type of damaged unit = Iron Deposit
Unit type of attacking unit = Miner

Add 10 to P(# owner of miner)IronOre

Is this even possible? Because that I know of there is no set variable thing for...
|set (conc.Strings[Player number of owner of miner][IronOre]) equal to (conc.Strings[Player number of owner of miner][IronOre]) + 10|
 
Ok let me try explaining this...

Player 1 has a miner attacking the ore rock, every few seconds it adds 10 to the variable P1IronOre

Player 2 has a miner attacking the ore rock, every few seconds it adds 10 to the variable P2IronOre

Player 3...

All the way through player 10, how would I simplify this down to just 1 trigger instead of 10?


Well Im off to bed, Ill check this in the morning...
 
Crap now Im hitting a problem with floating text...

Currently its...

Unit - Unit is attacked

(Unit Type of (Attacked Unit)) = Iron Deposit
(Unit Type of (Attacking Unit)) = Iron Ore

Set IronOre[(Player number of (Owner of Attacking unit)))] = (Iron Ore[(Player number of (Owner of (Attacking unit)))] +5

Floating Text - Create Floating Text that reads +5 at (Position of (Attacking Unit)) with Z offset 0.00, using font size 10.00. color (50.00%, 50.00%, 50.00%), and 0.00% transparency
Floating Text - Set the Velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 1.00

There are two problems here...
#1 If multiple people are mining ore it defines the *last created floating text* wrong, and will remove only one of the many if they are done at the same time.
#2 The Text isn't turning out right, I just want it to live maybe 1 second, but its staying permenently, and since WE doesn't show what the average age of floating text is, I have no clue what to put.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Unfortunately we are having a problem here... Since making multiple floating texts already requires JASS. Thing pretty nasty if you don't know it. So, you can either make a request (though I don't know when I'll have the time to fulfill it). And btw, floating texts are not my speciality... :roll: To be honest I never worked with them.

~Daelin
 
Level 2
Joined
Nov 4, 2004
Messages
23
You need to enable the lifespan.

Floating Text - Permanent/Expires

Disable it.

If your still having trouble with multiple ones, then you could make a seperate trigger for each player... Or try playing around with the Change Position and Show/Hide options, so that you can use a variable floating text instead of (last created floating text).
 
Status
Not open for further replies.
Top