1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  6. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] Make a AI controlled unit purchase from a shop (AI?)

Discussion in 'Triggers & Scripts' started by TKF, Dec 22, 2012.

  1. TKF

    TKF

    Joined:
    Nov 29, 2006
    Messages:
    1,237
    Resources:
    5
    Maps:
    5
    Resources:
    5
    Does it exist any scripts that makes a unit purchase from a shop, forcing an AI player to BUY a unit from a certain shop. In my map control panels "sells" units, so when you buy them you activate the panel. I want an AI to activate those panels, but I don't find any functions which can make it happen?

    All the AI functions in the map it controlled by triggers and functions. I have no AI scripts.


    Is there a code for doing that? A code which makes a unit buy a unit from a shop? Rep+ for useful help.

    Closest thing I get is to select that "console" unit, I lack the step of making it buy the unit triggerwise.



    (All questions related to AI buy mercenaries is unanswered which I googled. So is this impossible even with a jass script?)
     
  2. chaoslord301

    chaoslord301

    Joined:
    Sep 18, 2007
    Messages:
    105
    Resources:
    0
    Resources:
    0
    You could try to fake buy it by adding the unit and subtracting the money. I really couldn't figure it out either. If you can get it to select the shop you could also force the player to press the hotkey for the buy.
     
  3. TKF

    TKF

    Joined:
    Nov 29, 2006
    Messages:
    1,237
    Resources:
    5
    Maps:
    5
    Resources:
    5
    I tried the force player hotkey thing, but it didn't work out for me :/

    I made a workaround instead which was quite lot of work.
     
  4. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Try to use UnitInRange event,create an item,reduct gold cost or lumber to the ai player