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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. 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.

[Trigger] Item Ammo for Weapon

Discussion in 'Triggers & Scripts' started by Jay-D, Oct 27, 2008.

  1. Jay-D

    Jay-D

    Joined:
    Jun 29, 2008
    Messages:
    50
    Resources:
    0
    Resources:
    0
    ok i need a trigger that will allow my heros to reload theyre weapons with item ammo clips
    example
    Hero fires a weapon (machinegun with 30 ammunition). then ammo is emty. left click on 'ammo clip item' ammunition will get reloaded. every attack will decrease the number of machinegun items. the ammo should just reload the machine gun item. hope anyone could undersand my poor english
     
  2. Avator

    Avator

    Joined:
    Aug 23, 2008
    Messages:
    2,309
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    On the last day, He created the Search Button. And He saw it was good...
     
  3. DarkAngelAzazel

    DarkAngelAzazel

    Joined:
    Sep 14, 2008
    Messages:
    1,308
    Resources:
    0
    Resources:
    0
    I like your answer Avator ^^

    Well go for something like:

    Unit uses ability
    Ability = reload
    Event
    For 1-6
    If item in inventor slot "integer a" of triggering unit = ammo
    then enable attack, remove item

    else nothing
     
  4. raft_pl

    raft_pl

    Joined:
    May 27, 2006
    Messages:
    496
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Avators answer > all
    Sry for offtopic, just had to write that ; o
    (couldn't give more rep *sigh*)
     
  5. Jay-D

    Jay-D

    Joined:
    Jun 29, 2008
    Messages:
    50
    Resources:
    0
    Resources:
    0
    hmmm mybe that could work i'll give it a try thx man

    sorry but that doesnt solve my problem
     
    Last edited: Oct 29, 2008
  6. lnfernal

    lnfernal

    Joined:
    Dec 16, 2007
    Messages:
    243
    Resources:
    0
    Resources:
    0
    There's plenty of systems.

    But well you can do something like this

    When a unit got a item, also give him an ability, raise it to lvl 30. Everytime he attack, decrease the level. When it reaches 0, order him to stop everytime he issue order for target. Then when he cast the ability reload, set the lvl back to 30.
     
  7. Jay-D

    Jay-D

    Joined:
    Jun 29, 2008
    Messages:
    50
    Resources:
    0
    Resources:
    0
    finaly i made an ammo system for my map but its a little bit buggy. if you click on a weapon your hero will be changed to a unit (Hero (Assault Rifle) for example) and if you attack the number of charges decrease by 1 each attack. if your weapon is emty and you click on it it will be realoded (if you have the fitting ammo for it)
    Need Help for these Bugs
    -If you equip a weapon and theres a weapon already in your inventory (with 0 charges (EMTY)) you cant equip this weapon and you cant reload it. in fact its worthless.
     
    Last edited: Nov 1, 2008
  8. Jay-D

    Jay-D

    Joined:
    Jun 29, 2008
    Messages:
    50
    Resources:
    0
    Resources:
    0
    ....noone can help me :cry:
     
  9. wolfman

    wolfman

    Joined:
    May 31, 2008
    Messages:
    696
    Resources:
    0
    Resources:
    0
    try using mana. If a unit attacks take away 1 mana and dont allow it to attack if it has no mana left. |A unit attacks. Mana > 0. Set attacking units mana to (Attacking units mana - 1).| |A unit attacks. Mana equal to 0. Order attacking unit to stop.| Just make the ammo clips mana vials so you pick it up then use it and gain mana back. Or
    |A unit acquires item. Item is Ammo clip. Set triggering units mana to 30.| Hope this was helpful

    EDIT: Maybe im too late and this problem is solved (i read posts after i posted this). Oh well :p