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

Resources

Status
Not open for further replies.
Level 3
Joined
Sep 15, 2005
Messages
44
I get tired of only having lumber, gold, and food so i want to make a map where u need lumber, food/population as a whole, gold/gems, water, stone, and the amount of soldiers you have.

Is there anything in spells or does anyone know how to make one. I'm trying to use it in my roman map so it is more realistic. If anyone has any other ideas plz tell me.
 
Level 3
Joined
Sep 15, 2005
Messages
44
i was thinking about that but how do u subtract the resource if u spend some stone for instance say something costs 50 stone but i only have 10 on the leaderboard how to i stop it from working. like amount in stone=50 o rmore to spend
 
Level 6
Joined
Aug 22, 2006
Messages
253
This is how I would do it.
First you would need to create a variable for the resource being spent.
(Lets say a "temple" costs 10 gems. Lets make an integer variable [P1Gems].)

Trigger name: BuildingTemple

Events
Unit finishes construction

Conditions
Unit-type of (Constructed Structure) equal to (Temple)

Actions
If/
Owner of (Constructed Structure) equal to (Player 1 Red) AND [P1Gems] equal to or greater than 10
Then/
Do Nothing
Else/
Remove (Constructed Structure)
Message to Owner of (Constructed Structure): "You haven't got enough resources to build this building".

Of course you need need to make If/Then/Else triggers for however many players there are in the game. Thats just how I would do it - other people might have other ways :)
 
Level 3
Joined
Sep 15, 2005
Messages
44
how do i find the p1 gems thing i made the variable. i was making the condition, i got the half about owner of unit but to find integer condition that sais the varibable is greater then 10 i cant find it
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
I'd do it differently:

Variablelist:
Gems : Integer Variable : Array from 12
Constructingplayer : integer variable

Trigger name: BuildingTemple
events: unit begins constructing
conditions: unit-type of constructed structure = temple
actions: set Constructingplayer= Player number of owner of constructing structure
If: Gems[Constructingplayer] >= 10
then: set Gems [constructingplayer]= (Gems[constructingplayer] - 10)
else: remove constructing unit from the game
Message to owner of constructing structure : blabla

EDITED The constructingplayer
 
Level 6
Joined
Aug 22, 2006
Messages
253
Constructing Player is (Owner of (Constructing Unit), its an event response. You can use my method or Eleandors method, whichever one you find more comfortable/easier, they both work.
 
Status
Not open for further replies.
Top