GetSavingPlayer(), Testers Needed

Azlier

Old World Ghost
Reaction score
461
So, now that I've gone totally insane, I would like one more thing to be tested.

Online (LAN or Battle.net doesn't matter) would be nice, because I want to test if this desyncs. Or works at all.

Save the game, it's supposed to display the name of the player who saved it. If you get syntax errors, report them with the errors you get and which line it's on.

Note: This is terribly inefficient with some unnecessary handles. But it should work. Hopefully.

[lJASS]requires[/lJASS] Event
JASS:
library GetSavingPlayer initializer Init requires Event //Note to self: needs polishing.

globals
    private Event Ev
    private player SavingPlayer = null
    private unit array U
    private integer LocalId
endglobals

constant function GetSavingPlayer takes nothing returns player
    return SavingPlayer
endfunction

function TriggerRegisterGameSaved takes trigger t returns nothing
    call Ev.register(t)
endfunction

private function OnClick takes nothing returns boolean
    set SavingPlayer = GetOwningPlayer(GetTriggerUnit())
    call Ev.fire()
    ////////////////////////////////////////////
    call BJDebugMsg(GetPlayerName(SavingPlayer))
    ////////////////////////////////////////////
    set SavingPlayer = null
    return false
endfunction

private function OnSave takes nothing returns boolean
    call SelectUnit(U[LocalId], true)
    call SelectUnit(U[LocalId], false)
    return false
endfunction

private function Init takes nothing returns nothing
    local trigger t
    local integer i = 11
    set LocalId = GetPlayerId(GetLocalPlayer())
    set Ev = Event.create()
    loop
        set t = CreateTrigger()
        call TriggerRegisterGameEvent(t, EVENT_GAME_SAVE)
        call TriggerAddCondition(t, Condition(function OnSave))
        if GetLocalPlayer() != Player(i) then
            call DisableTrigger(t)
        endif

        set t = CreateTrigger()
        set U<i> = CreateUnit(Player(i), &#039;hfoo&#039;, 10000, 10000, 270)
        call PauseUnit(U<i>, true)
        call TriggerRegisterUnitEvent(t, U<i>, EVENT_UNIT_SELECTED)
        call TriggerAddCondition(t, Condition(function OnClick))
        exitwhen i == 0
        set i = i - 1
    endloop
endfunction

endlibrary</i></i></i>
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
It seems to be returning the right player, but I haven't had a chance to get more than 1 person to test with.
 

ZakkWylde-

New Member
Reaction score
14
:D:D

Thanks! I'll try this out...
I'll also try to get results of your other test back...

And uh...what does this need? Are you using KT2? (I'm noob at the extension languages)
 

Azlier

Old World Ghost
Reaction score
461
This needs Event. I gotta update the first post.

Just save the game in-game online, and tell me if it displays your name.

Have the other players save, too.
 

ZakkWylde-

New Member
Reaction score
14
Zzzz...
Where do I get Event?

I'm assuming that'll fix the problem of this saving...and returning

Missing Requirement: Event (libraries cannot require scopes)
 

Azlier

Old World Ghost
Reaction score
461
I linked it, you know. Twice.
 

ZakkWylde-

New Member
Reaction score
14
QQQQQ.

Yeah I found it...i was testing it :D
As it turns out, when Player 1 (blue) saved the game, it displayed both Player 0 and 1's names...So .... not quite working...I'll try and run a few more tests.
 

Azlier

Old World Ghost
Reaction score
461
Method 2 it is, then. Please stand by.

EDIT: Try it now.
 

ZakkWylde-

New Member
Reaction score
14
Unfortunately, it continues to display the names of all the players...

If 3 people are in the game, it displays all three from player 0 to player 2
...it always displays player 0's name first (if he's in the game)

EDIT: WRONG INFO...posting again.
 

Azlier

Old World Ghost
Reaction score
461
It needs a rewrite, yes it does. I need to try my third method. It'll be done in an hour or so.
 

ZakkWylde-

New Member
Reaction score
14
Ok, 3 people...

3 slots (2 people are on Force 1, one person is on Force 2) Red, Blue, Teal, respectively

Blue (second slot) saves. It shows Red's name, Blue's name, Teal's name.
Red (first slot) saves. It shows Red's name, Teal's name, Blue's name.
Teal (third slot) saves. It shows Red's name, Teal's name, Blue's name.

I'm not sure if it is the case that whoever saves has their name in second? (Unless its red?!?) :confused:

If so, that info could be used as well...

EDIT/Addition: Yo, Az, I'll be back later tonight...maybe in about 3-4 hours...so I'll be able to test once again at that time. Thanks again for the help. I really appreciate it.

EDIT #2: I figured it out -- its on the next page...I made sense of the information (a little bit of educated guessing, but the thought-pattern seems to follow sequentially and coherently)
 

Azlier

Old World Ghost
Reaction score
461
I now realize that... this won't work. :(

I can't come up with another method that would work.

This study can be postponed until further notice.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Just a random thought, but try using the GetDelay thing to calculate the ping, and base it off of that.

It's a completely random thought, and I'm thinking it won't work, but meh.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Bah I'm an idiot. That's what I get, posting half-awake. >.<
 

ZakkWylde-

New Member
Reaction score
14
Ok, 3 people...

3 slots (2 people are on Force 1, one person is on Force 2) Red, Blue, Teal, respectively

Blue (second slot) saves. It shows Red's name, Blue's name, Teal's name.
Red (first slot) saves. It shows Red's name, Teal's name, Blue's name.
Teal (third slot) saves. It shows Red's name, Teal's name, Blue's name.

I'm not sure if it is the case that whoever saves has their name in second? (Unless its red?!?) :confused:

If so, that info could be used as well...

EDIT/Addition: Yo, Az, I'll be back later tonight...maybe in about 3-4 hours...so I'll be able to test once again at that time. Thanks again for the help. I really appreciate it.

Uh...I figured it out...
Your script does work. It just has to differentiate between the person who INITIATED the save and everyone (who saves the game). Because everyone gets the save file, everyone's name shows up. And it shows up in the order that people save it (i.e., the names show up sequentially...about every .5 seconds...)

It seems the host saves it first and the person who initiated the save saves it second. Then the order (probably) goes from player 0 to player 11 excluding the two (or one, if host = saver) people who already have the save file.

Maybe this insight will help you out...if I totally understood your script, I could probably fiddle around with it to get it right.
 

Azlier

Old World Ghost
Reaction score
461
Fiddle away. I don't know how to act on "information" like that.
 

ZakkWylde-

New Member
Reaction score
14
...if I totally understood your script, I could probably fiddle around with it to get it right.

And there is the problem. I could spend some time going through Event I guess...but could you explain the basics OR could I come to ask you if I run into trouble?

But anyways, I was thinking along the lines of kicking the second name that shows, unlessssssss someway to figure out that is or isn't host who is saving...
This method doesn't make sense to you? =P I don't know if its possible or how many conditions it will require....if then if then?
 

Azlier

Old World Ghost
Reaction score
461
Well, Event doesn't really have anything to do with the script. Remove it, if you want.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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