• 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.

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