ORBEngine by Cohadar

Expelliarmus

Where to change the sig?
Reaction score
48
Yes, this topic again.
I got ORBEngine system from the SandBox v3.1 of Pyramidal Defence(also by Cohadar) if people wanted to know.
My problem:
I don't the get the system at all, I need explanation. :eek:
JASS:
//==============================================================================
library ManaShield initializer Init uses ORBEngine

//==============================================================================
private function Conditions takes nothing returns boolean
    local real damage = GetEventDamage()
    local real mana = GetUnitState(GetTriggerUnit(), UNIT_STATE_MANA)
    
    if damage >= mana then
        call SetUnitState(GetTriggerUnit(), UNIT_STATE_MANA, 0)
        call ORBEngine_ReduceDamage(mana)
    else
        call SetUnitState(GetTriggerUnit(), UNIT_STATE_MANA, mana-damage)
        call ORBEngine_ReduceDamage(damage)
    endif
    
    return false
endfunction

//==============================================================================
private function Init takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerAddCondition(trig, Condition(function Conditions))
    call ORBEngine_RegisterOrbShield(trig, AID_SKILL_MANASHIELD, SCOPE_PREFIX)
endfunction

endlibrary

In the above example (which was from Post #129)
- Why is it in the library?
- What possible scope is used in conjunction with this library?
- How is trig a function?
- Where is ORBEngine_ReduceDamage()? It is not in the Sandbox version of ORBEngine.

Thankyou
 

Expelliarmus

Where to change the sig?
Reaction score
48
Nice, you explained every question here with 1 word.
So call ORBEngine_RegisterOrbShield() takes trigger, Ability Id, and SCOPE_PREFIX? No more string description?
 

saw792

Is known to say things. That is all.
Reaction score
280
1. It's not 'in' the library. It is a library itself. Libraries are not reserved for systems. The library is acting exactly like a scope in this case. The only differences between libraries and scopes is that a library is placed at the top of the script code, and cannot be nested (NB: may have missed a difference... hmm).
2. No possible scope... that isn't the system, it's just a spell. Note the 'requires ORBEngine' line. ORBEngine is the library that contains the system.
3. What? Trig isn't a function... it's a trigger...
4. ORBEngine_ReduceDamage is a public member of the ORBEngine library. Thus, the function will be called ReduceDamage inside the library. The public designation means that the function needs the library name as a prefix when calling the function outside the library.

Was that sarcasm towards Cohadar? He was merely making a comment about his system in a relevant thread, also letting you know that ORBEngine is old...
 

Expelliarmus

Where to change the sig?
Reaction score
48
Was that sarcasm towards Cohadar?
No, it was a +rep comment ^_^
1. <No comment>
2. Hmm, and the declaration of globals? AID_SKILL_MANASHIELD, SCOPE_PREFIX
3. Umm..I mean the Old ORBEngine_RegisterOrbShield takes function, ability id (integer) and description (string).
In that example it took a trigger instead of a function. This was question 3.
4. As I was saying, Old answered everything... ReduceDamage wasn't in the old ORBEngine. I was confused on where it was in the library.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top