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

1 Question

Status
Not open for further replies.
Level 6
Joined
Feb 18, 2010
Messages
153
Well it sounds abit onfusing but here it is

  • Events
    • Player - Player 1 (Red) types a chat message containing -Buy as An exact match
    • Player - Player 2 (Blue) types a chat message containing -Buy as An exact match
    • Player - Player 3 (Teal) types a chat message containing -Buy as An exact match
    • Player - Player 4 (Purple) types a chat message containing -Buy as An exact match
    • Player - Player 5 (Yellow) types a chat message containing -Buy as An exact match
    • Player - Player 6 (Orange) types a chat message containing -Buy as An exact match
    • Player - Player 7 (Green) types a chat message containing -Buy as An exact match
    • Player - Player 8 (Pink) types a chat message containing -Buy as An exact match
    • Player - Player 9 (Gray) types a chat message containing -Buy as An exact match
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region <gen> contains (Triggering unit)) Equal to True
      • Then - Actions
        • Item - CreateItem at (Center of (Playable map area))
        • Wait 0.04 seconds
        • Hero - Give (Last created item) to (Triggering unit)
        • Wait 2.00 seconds
        • Trigger - Turn off (This trigger)
      • Else - Actions
        • Do nothing
right i want to make this so when you are in a region and you type -buy it will give you a item but you have to be in that region


also while im here might aswell ask

when you have the item i want if you type -sell and your in that region it sells item and gives you cash and renab;le the last trigger to buy again
 
Level 13
Joined
Mar 24, 2010
Messages
950
Ok first off i need to know a bit more.

how many heros per person are possible in this game of yours?
is there only 1 item type that -Buy will get you?
is this item able to be bought more than once by the same player?

also unless 100% needed u shouldnt use waits in a trigger if u want it MUI
 
Level 6
Joined
Feb 18, 2010
Messages
153
well only 1 hero is allowed in map and item only allowed to be bought 1nces and if that person who bought it sells it -sell it allows 1 person to buy it again

hope ye understand
 
Level 13
Joined
Mar 24, 2010
Messages
950
Oh ok so theres only 1 item total that can be bought thats why you turn off the trigger i see now.

well what your going to want to do it make a Unit array 1-12 (if theres 12 players possible with 1 hero a per player)
that way you can do the check easy.

take out he wait's also
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
well the problem with your tigger is that you cant give the item to the tiggering unit because there is no triggering unit

triggering unit will only work with the event unit - xxxxxx

you neeed to use
player types -buy

unit group pick unit in region matching is owned by triggering player
give picked unit your item
 
Level 13
Joined
Mar 24, 2010
Messages
950
Well it sounds abit onfusing but here it is

  • Events
    • Player - Player 1 (Red) types a chat message containing -Buy as An exact match
    • Player - Player 2 (Blue) types a chat message containing -Buy as An exact match
    • Player - Player 3 (Teal) types a chat message containing -Buy as An exact match
    • Player - Player 4 (Purple) types a chat message containing -Buy as An exact match
    • Player - Player 5 (Yellow) types a chat message containing -Buy as An exact match
    • Player - Player 6 (Orange) types a chat message containing -Buy as An exact match
    • Player - Player 7 (Green) types a chat message containing -Buy as An exact match
    • Player - Player 8 (Pink) types a chat message containing -Buy as An exact match
    • Player - Player 9 (Gray) types a chat message containing -Buy as An exact match
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region <gen> contains ((Hero_Unit[Player number of (Triggering Player]))) Equal to True
      • Then - Actions
        • Item - CreateItem at (Center of (Playable map area))
        • Hero - Give (Last created item) to (Triggering unit)
        • Trigger - Turn off (This trigger)
      • Else - Actions
right i want to make this so when you are in a region and you type -buy it will give you a item but you have to be in that region


also while im here might aswell ask

when you have the item i want if you type -sell and your in that region it sells item and gives you cash and renab;le the last trigger to buy again

Thats how you can do it if u want.
Just make sure to set those heros in your map Init
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
EDIT

Try this...It will deduct and add your gold as well...

  • Buy
    • Events
      • Player - Player 1 (Red) types a chat message containing -buy as An exact match
      • Player - Player 2 (Blue) types a chat message containing -buy as An exact match
    • Conditions
      • (Number of units in (Units in Region 000 <gen> owned by (Triggering player))) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) Current gold) Greater than 800
        • Then - Actions
          • Hero - Create Claws of Attack +15 and give it to (Random unit from (Units in Region 000 <gen> owned by (Triggering player)))
          • Player - Add -800 to (Triggering player) Current gold
          • Set item = (Last created item)
        • Else - Actions
          • Game - Display to (All players) the text: You dont have enoug...
  • Sell
    • Events
      • Player - Player 1 (Red) types a chat message containing -sell as An exact match
      • Player - Player 2 (Blue) types a chat message containing -sell as An exact match
    • Conditions
      • (Number of units in (Units in Region 000 <gen> owned by (Triggering player))) Greater than 0
    • Actions
      • Item - Remove (Item carried by (Random unit from (Units in Region 000 <gen> owned by (Triggering player))) of type (Item-type of item))
      • Player - Add 400 to (Triggering player) Current gold
 
Last edited:
Level 6
Joined
Feb 18, 2010
Messages
153
ok but i cant find

(Number of units in (Units in Region 000 <gen> owned by (Triggering player))) Greater than 0

EDIT NVM found it

EDIT: now i cant find ((Triggering player) Current gold) Greater than 800

EDIT: Found it

Thanx i got that sorted now but theres a problem

if you have 5k you type -buy and it takes 5k not 2.5k
 
Last edited:
Level 6
Joined
Feb 18, 2010
Messages
153
No probs...



you have to edit this trigger for that matter...

  • Player - Add -2500 to (Triggering player) Current gold
you must use "negative" number for buying...

it is like that but if you have 2x more or 3x more it takes it all
 
Level 6
Joined
Feb 18, 2010
Messages
153
ok heres test map the house is only 2.5k but if you buy it and have 5k it takes 5k if you have 4,999 it only takes 2500

anyways i set up a test you have to be in one of them regions to use -buy
 

Attachments

  • Winter Land v1.0T.w3x
    343.9 KB · Views: 45
Level 29
Joined
Mar 10, 2009
Messages
5,016
ok heres test map the house is only 2.5k but if you buy it and have 5k it takes 5k if you have 4,999 it only takes 2500

anyways i set up a test you have to be in one of them regions to use -buy

ok, im gonna test it once i get home from office


EDIT:

I already tested 3 times and it's OK, if you have 5000 then it will deduct only 2500 when you enter -Buy...

Proof? Look at the image...
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
So you want the dealing stuff to be more on Condition ???
From what I understand, you want it to be:
If the player have gold less than 5000, the item price is 2500
If the player have gold greater than or equal to 5000, the item price is 5000

  • Buy
    • Events
      • Player - Player 1 (Red) types a chat message containing -Buy as A substring
    • Conditions
      • (Number of units in (Units in (Playable map area))) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Triggering Unit (Current gold) Greater than or equal to 5000
        • Then - Actions
          • Hero - Create Item and give it to (Triggering unit)
          • Player - Add -5000 to Triggering Unit Current gold
        • Else - Actions
          • Hero - Create Item and give it to (Triggering unit)
          • Player - Add Triggering Unit Current gold to -2500
Try this
 
Level 6
Joined
Feb 18, 2010
Messages
153
ok, im gonna test it once i get home from office


EDIT:

I already tested 3 times and it's OK, if you have 5000 then it will deduct only 2500 when you enter -Buy...

Proof? Look at the image...

well i tested it and it took it all but thanx
 
Status
Not open for further replies.
Top