• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Courrier cant buy items, cause it need to be selected by the marketplace.

Status
Not open for further replies.
Level 6
Joined
Jan 4, 2014
Messages
227
Courrier cant buy items, until it gets out of MarketPlace Range and then re-enter that range, so i want to avoid moving it out and in and buy items if no hero is nearby.

i tried to hide and then unhide the unit after its selected by the player but it does not work.

can some suggest me a trigger pleas ?

Thanks :)
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
You can force the marketplace to select it buy ordering it to caster select unit on the courier once it spawns.

Or you can move the unit to the middle of the map and then instantly move it to the shop. Technically it should have left the zone, but the player wont notice since human eyes are bad.
 
Level 6
Joined
Jan 4, 2014
Messages
227
i will try the 2nd methode thanks :)

EDIT : the second methode did not work, i will try the 1st Methode.
 
Last edited:
Level 6
Joined
Jan 4, 2014
Messages
227
@Chaosy hi again !
i cant find how to issue "Select unit" order by the market place :(
can you give me hint on how to trigger it ??
 
Level 12
Joined
Oct 16, 2010
Messages
680
  • Events
    • Unit - Unit is issued an order targeting a unit
  • Conditions
  • Actions
    • Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))
-insert this to map
-place a shop owned by you

in game use manually the pick ability of the shop and the order id will be displayed ( write it down )

then use in triggers this

  • Custom script: call IssueTargetOrder( shop unit , order , target unit )
shop unit : unit variable ( if its a GUI variable , use "udg_" before variable name)
order: number(the one u wrote down) or integer variable ( containing the number:D)
target unit : unit variable

example:
  • Set TempUnit = (Triggering Unit)
  • Set TempTarget = (Target of Issued order)
  • Custom script: call IssueTargetOrder( udg_TempUnit , 802430 , udg_TempTarget )
802430 is just a random number :D use the one you wrote down
 
Level 6
Joined
Jan 4, 2014
Messages
227
Wow ! Thanks man, i will need that trick during the whole development phase :)

EDIT : BTW, order code is a string, so i did put it between brackets.
 
Last edited:
Level 6
Joined
Jan 4, 2014
Messages
227
ooops ! it does not seems to be working, exactly the "call IssueTargetOrder" part.

whats wrong with my code :

Refresh
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit
Player - Player 7 (Green) Selects a unit
Player - Player 8 (Pink) Selects a unit
Player - Player 9 (Gray) Selects a unit
Player - Player 10 (Light Blue) Selects a unit
Player - Player 11 (Dark Green) Selects a unit
Player - Player 12 (Brown) Selects a unit
Conditions
(Owner of (Triggering unit)) Equal to (==) (Triggering player)
(Unit-type of (Triggering unit)) Equal to (==) Courier
Actions
Set ShopCourrier = (Triggering unit)
Unit Group - Pick every unit in (Units within 1024.00 of (Position of (Triggering unit))) and do (Actions)
Loop - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A structure) Equal to (==) True
Then - Actions
Set ShopPickedShop = (Picked unit)
Game - Display to (All players) the text: (Name of ShopPickedShop)
Custom script: call IssueTargetOrder( udg_ShopPickedShop , "852566" , udg_ShopCourrier )
Else - Actions

it does not select the courrier even if there is no hero.
Whats Wrong ??
 
Level 12
Joined
Oct 16, 2010
Messages
680
EDIT : BTW, order code is a string, so i did put it between brackets.
order string and the actual order id is not the same. issuetargetorder() uses the id, and it is an integer

remove the "" around 852566 as then jass compiler will think of it as string and it needs integer:)


EDIT: ow... my bad sory:D the exact name of the function is IssueTargetOrderById()
No wonder why it doesen't works:D
I don't have WE with me:p

EDIT:
also for better reading, encapsule your trigger --> [trigger] "trigger goes here" [/trigger]

shows this

  • "trigger goes here"
 
Last edited:
Level 6
Joined
Jan 4, 2014
Messages
227
@Lender , The compiler was not able to compile it without quotes, but its okey the problem has been solved, i did not need triggers, just some tweaking in the "select unit" ability :

Data - Interaction type : any

Thats all !!
 
Status
Not open for further replies.
Top