Snippet GetHost 2.0

Azlier

Old World Ghost
Reaction score
461
The point was to make it easy. Yes, Event is better.

What would you recommend? Event and the current setup, one or the other?
 

Azlier

Old World Ghost
Reaction score
461
Allow Event and the code taking function, or just use Event or the code taking function?

I feel that both is best.
 

Jesus4Lyf

Good Idea™
Reaction score
397
I'd just put Event in personally.

But up to you.

If you're wondering about efficiency, it's the comparison between looping through triggers with JASS or stacking trigger conditions on one trigger.

In other words, the speed difference between TT/TU and KT2. Which is only even vaguely noticable because of the number of times it fires per second. :p
 

Azlier

Old World Ghost
Reaction score
461
I could care less about speed. It's just that the code is quicker to use. I'll implement Event though.
 

saw792

Is known to say things. That is all.
Reaction score
280
So has this been thoroughly tested with the host in different player slots and such?
 

Azlier

Old World Ghost
Reaction score
461
>So has this been thoroughly tested with the host in different player slots and such?

Indeed it has. I made absolutely sure my tester tested with different hosts, different slots, etc.


Event added. I need to document the functions, still.
 

Azlier

Old World Ghost
Reaction score
461
I guess. I don't know if it's more reliable or not.
 

Azlier

Old World Ghost
Reaction score
461
Hehehe. This is more efficient than that, Nestharus. Mine doesn't mess with timer timeouts (which are somewhat inaccurate), either.

This is basically the core of GetDelay without a timer or anything.
 

Nestharus

o-o
Reaction score
84
Also, why are you doing this?
JASS:
    set i = 11
    loop
        call TriggerRegisterPlayerEvent(t, Player(i), EVENT_PLAYER_LEAVE)
        exitwhen i == 0
        set i = i - 1
    endloop
    call TriggerAddCondition(t, Condition(function RecalculateHost))


You should only register active human players : \.

And what I was pointing out before with oh well was that this is the exact same thing as my host add on except that my host add on uses GetDelay =P.

Furthermore, host should only be recalculated when the actual host leaves.

And next, this could actually be made more efficient by only adding the current host to the recalculate trigger and continuing to add subsequent hosts as the host leaves, this way 0 handles are wasted and it maintains optimum speed.
 

Azlier

Old World Ghost
Reaction score
461
Does it matter? Are around 5 extra handles going to kill you?
 

Nestharus

o-o
Reaction score
84
....

So you are telling me it is good enough? A true programmer would always aspire to improve their code -.-. /sigh

Look at Jesus4Lyf, he's a serious perfectionist. As a result, the stuff he writes is fantastic =).

If you know there is something in your code that can be improved, you should just improve it instead of saying, eh, it's good enough ><.

This is the attitude I absolutely detest ><, heh, which is why I generally program everything myself. Too many programmers have this attitude, so there are hardly any resources out there that I can use : (.

Anyways, this small thing would take under a minute to fix. You should just fix it ><
 

Azlier

Old World Ghost
Reaction score
461
Maybe because performing a bunch of checks is most likely less efficient?

/shrug

>Furthermore, host should only be recalculated when the actual host leaves.

Good point.

>Anyways, this small thing would take under a minute to fix.

Not when you're working in Notepad :p.
 

Nestharus

o-o
Reaction score
84
If you perfect this, I'll just delete my hosting add on. In fact, hosting add on doesn't even need Ptn because of some of the stuff I pointed out = P, then again the wrappers, (GetPlayer()).

Oh well =).

Hopefully this and a Ptn without the hosting add on will get approved. Not going to bother updating the hosting add on in ptn as it would be exactly like yours but with the fixes I mentioned and it'd be using the Ptn GetPlayer() function.

In fact, I'll delete it right now ^_^.
 

Azlier

Old World Ghost
Reaction score
461
I'll revamp it PTn style next weekend (when I have TESH and friends). For now, I say it's quite good enough, especially considering it runs only a maximum of 12 times per map.
 
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