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

System Request :)

Status
Not open for further replies.

_PV

_PV

Level 7
Joined
Aug 28, 2010
Messages
285
Ah hey guys.

Can someone please help me with a Line Of Sight system?
Follow these smexy screenshots to see what I mean :D

Also* I need an ammunition and reload system.
(E.G. your gold indicates the amount of bullets you have loaded ATM and your lumber indicates how many cartridges you have left.)

Help will be greatly appreciated :)
 

Attachments

  • good line of sight.JPG
    good line of sight.JPG
    67.7 KB · Views: 68
  • dafaq.JPG
    dafaq.JPG
    41.1 KB · Views: 68
  • dafaq2.JPG
    dafaq2.JPG
    36.5 KB · Views: 63
  • dafaq 3.JPG
    dafaq 3.JPG
    49.1 KB · Views: 72
Here is a snippet of an ammunition system I made for myself. Uses Mana instead of Gold.
JASS:
library Ammunition initializer init
    globals
        private constant real TimerInterval = 1.0
        private constant group HotUnits = CreateGroup()
        private constant timer T = CreateTimer()
    endglobals
    
    function MakeUnitOverheat takes unit u returns nothing
        if(IsUnitInGroup(u,HotUnits)) then
            return
        endif
        call UnitAddAbility(u,'Abun') //Disable Attack
        call GroupAddUnit(HotUnits,u)
    endfunction
    
    private function CoolDown takes nothing returns nothing
        local unit u=GetEnumUnit()
        if (GetUnitState(u,UNIT_STATE_MANA) == GetUnitState(u,UNIT_STATE_MAX_MANA)) then
            call UnitRemoveAbility(u,'Abun')
            call GroupRemoveUnit(HotUnits,u)
        endif
    endfunction
    
    private function DeathsChill takes nothing returns boolean
    local unit u=GetTriggerUnit()
        if IsUnitInGroup(u,HotUnits) then
            call UnitRemoveAbility(u,'Abun')
            call GroupRemoveUnit(HotUnits,u)
        endif
        return false
    endfunction
    
    private function Enum takes nothing returns nothing
        call ForGroup(HotUnits,function CoolDown)
    endfunction
    
    private function init takes nothing returns nothing
        local trigger trig=CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_DEATH)
        call TriggerAddCondition(trig,Condition(function DeathsChill))
        call TimerStart(T,TimerInterval,true,function Enum)
    endfunction
endlibrary
Must be linked to a Damage Detection System which calls MakeUnitOverheat and nulls the Damage on the Target when the Attacker's Mana is 0. Requires jnpg.
It disables a Unit's attack when the Clip is empty, and only releases it again when the Mana is full (It is reminiscient of the Mass Effect 1 'ammo' system, where your weapons would overheat instead of running out of clips). Reload was made with the "Remove Gold or Wood" (Aans) Ability, set to need 1 wood and then caught by a trigger to reset the mana to full.
 
  • Like
Reactions: _PV

_PV

_PV

Level 7
Joined
Aug 28, 2010
Messages
285
Shit, I've never dealt with JASS scripts before :S But it seems legit :? after I read it through a few times, that is...

It seems logical and should work, but I don't know how to import this entire script into my map.
Can I just use the-
Custom script: custom
And copy the entire script in there or what should I do? :?

Thanks anyway :)
 
Status
Not open for further replies.
Top