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

i need someone to make me a trigger set

Status
Not open for further replies.
Level 2
Joined
Aug 20, 2008
Messages
12
i need someone to make me a set of trigger that reload a gun by taking 1 charge away from an item then adds to another btw i also need help with.... how do you make a unit that cant attack until a unit equips a weapon further more how do you make a single unit that that when equips a weapon it changes the attack animation and stats like lets say i have a flamethrower with fire wave animation and a regular gun with a bullet animation with different stats and stuff but they change when that certain weapon is equipped and when i change the marines attack animation to something like a flamethrower it still poops out bullets but flames are going as well also i need a save and load system and how to use it i know alot of questions you can answer one at a time or all at once or whatever but please help:cute:
 
Level 1
Joined
Jan 21, 2008
Messages
7
well, Fir the changing of the weapons and and weapon types, you could have a trigger that detects when a unit uses an item, and then replace the unit that used it with a unit that has the effects that you want?

Fir the bullets, you could just use the jass code
JASS:
SetItemCharges takes item whichItem, integer charges returns nothing
For example
JASS:
struct loadbullet

private function conditions takes nothing returns boolean
    return GetManipulatedItem() = 'bult'

private function actions takes nothing returns nothing
    local integer clipslot
    local item clipitem 
    local integer i = 0
    loop
        exitwhen i > 6
        if UnitItemInSlot ( GetTriggerUnit(), i ) == 'clip' then
            set clipslot = i
            set clipitem = UnitItemInSlot ( GetTriggerUnit(), clipslot )
        endif
        set i = i + 1
    endloop
    call SetItemCharges ( GetManipulatedItem (), GetItemCharges( GetManipulatedItem() )-1 )
    call SetItemCharges ( clipitem, GetItemCharges( clipitem )+1 )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_USE_ITEM )
    call TriggerAddCondition( t, Condition( function condtions ) )
    call TriggerAddAction( t, function actions )
endfunction

endstruct
 
Level 2
Joined
Aug 20, 2008
Messages
12
thanks

well, Fir the changing of the weapons and and weapon types, you could have a trigger that detects when a unit uses an item, and then replace the unit that used it with a unit that has the effects that you want?

Fir the bullets, you could just use the jass code
JASS:
SetItemCharges takes item whichItem, integer charges returns nothing
For example
JASS:
struct loadbullet

private function conditions takes nothing returns boolean
    return GetManipulatedItem() = 'bult'

private function actions takes nothing returns nothing
    local integer clipslot
    local item clipitem 
    local integer i = 0
    loop
        exitwhen i > 6
        if UnitItemInSlot ( GetTriggerUnit(), i ) == 'clip' then
            set clipslot = i
            set clipitem = UnitItemInSlot ( GetTriggerUnit(), clipslot )
        endif
        set i = i + 1
    endloop
    call SetItemCharges ( GetManipulatedItem (), GetItemCharges( GetManipulatedItem() )-1 )
    call SetItemCharges ( clipitem, GetItemCharges( clipitem )+1 )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_USE_ITEM )
    call TriggerAddCondition( t, Condition( function condtions ) )
    call TriggerAddAction( t, function actions )
endfunction

endstruct

thanks you the only one that has tried helping me everyone else complains its in the wrong categorys:infl_thumbs_up:
 
Status
Not open for further replies.
Top