• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Gold... Lumber... Food.. And another resource?

Status
Not open for further replies.
Level 6
Joined
May 27, 2007
Messages
162
Hey fellow hive members.

I'm considering if this, in theory, would be possible...

Create a dummy unit with a 2D planar model, textured as a 'new resource'.
Every 0.01 game seconds, move this dummy unit to the centre of players camera view, offset by 450x and 850y (to keep it about 100 units to the left of the current gold resource icon).
Set the custom value of this unit to 0.
Create a floating point message, just to the right of the dummy unit displaying that dummy unit's custom value.
Increasing the custom value whenever the player gains this 3rd resource.
Decreasing the custom value whenever the player spends this 3rd resource.

In my current map, I currently have 2 resources: Gold is used as Metal, and Lumber is used as Gas. Food is still Food (well Energy). The third resource, will be Cash/Capital/Gold. And is only used for researches and upgrades. The player generates Cash/Capital/Gold every 30 seconds, an x amount for each Industry building he has.

What do you think? Any inherrent problems I havn't thought about?

{EDIT}
Well I've managed to do it using this

Locking Camera to a Unit:
  • lock camera
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to Footman 0005 <gen>, offset by (0.00, 0.00) using Default rotation
Creating Floating Texts:
  • create floating texts
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads (String((Custom value of Dummy Mithril 0000 <gen>))) at ((Position of Footman 0005 <gen>) offset by (225.00, 450.00)) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set floatingResources[1] = (Last created floating text)
      • Floating Text - Create floating text that reads (String((Custom value of Dummy Knowledge 0006 <gen>))) at ((Position of Footman 0005 <gen>) offset by (425.00, 450.00)) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set floatingResources[2] = (Last created floating text)
Keeping Dummy 'Icons' In place, relating to unit's position.
  • keep gold counters in place
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit - Move Dummy Mithril 0000 <gen> instantly to ((Position of Footman 0005 <gen>) offset by (175.00, 450.00))
      • Unit - Move Dummy Knowledge 0006 <gen> instantly to ((Position of Footman 0005 <gen>) offset by (375.00, 450.00))
Keeping texts in place, using unit location AND dummy unit's custom value.
  • keep floating texts in place and up to date
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Floating Text - Change the position of floatingResources[1] to ((Position of Footman 0005 <gen>) offset by (345.00, 575.00)) with Z offset 0.00
      • Floating Text - Change text of floatingResources[1] to (String((Custom value of Dummy Mithril 0000 <gen>))) using font size 8.00
      • Floating Text - Change the position of floatingResources[2] to ((Position of Footman 0005 <gen>) offset by (585.00, 575.00)) with Z offset 0.00
      • Floating Text - Change text of floatingResources[2] to (String((Custom value of Dummy Knowledge 0006 <gen>))) using font size 8.00
What do you guys think?
 
Last edited by a moderator:
Well there is some other way with multiboard and few trigger that will count resources for players!

You can create custom resource like this:

1st. - Simple kill, after each unit that player kill it will increase your resource (call it exp or whatever) then just create trigger that will check resource each time when player want to buy unit or whatever (remove unit and give back gold if is resource below minimal or just stop training etc etc or just reduce resource integer if it is ok)

2nd. - Create some ability and give to lets say farm unit (building) Then with triggers cast spell each 10 seconds or whatever (another trigger will count specific buff or number of farms x spell level or anything you imagine)

...

You can see that there is large number of options, you just need to pick one that will be best for you!
Also you must use multiboard to show to all players number of resources!
 
Level 6
Joined
May 27, 2007
Messages
162
The problem I have with locking the camera to a unit and then putting the dummy resources offset from that unit is... whenever there is elevation in the terrain, they go all weird. I'm trying now to somehow lock the players camera to a dummy unit, offset the dummy units (resources) from the center of his screen? possible?
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
I tried making what you said,but i had some problems with height :slp:
However,these triggers i've made could maybe prove useful to you:
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempPoints[0] = (Center of (Playable map area))
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Resource for (Player((Integer A))) at TempPoints[0] facing Default building facing degrees
          • Set Resource[(Integer A)] = (Last created unit)
      • Custom script: call RemoveLocation(udg_TempPoints[0])
  • Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Custom script: if GetLocalPlayer() == GetEnumPlayer() then
          • Set TempPoints[0] = (Target of current camera view)
          • Custom script: endif
          • Set TempPoints[1] = (TempPoints[0] offset by (200.00, 300.00))
          • Custom script: set udg_Height = GetLocationZ(udg_TempPoints[1])
          • Unit - Move Resource[(Player number of (Picked player))] instantly to TempPoints[1]
          • Animation - Change Resource[(Player number of (Picked player))] flying height to (300.00 - Height) at 0.00
          • Custom script: call RemoveLocation(udg_TempPoints[0])
          • Custom script: call RemoveLocation(udg_TempPoints[1])
Note: 'Height' is a real variable and 'Resource' is a dummy unit with locust and permanent invisibility with 0 fading time (To make it unseen by other players)
 
Level 6
Joined
May 27, 2007
Messages
162
Thanks Garfield... That does seem to clear up a few issues... The flying Height is clever :) and the permanent invisibility - didn't really think about that! Will try it out later today! +rep to you my friend.
 
Status
Not open for further replies.
Top