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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top