GetSavingPlayer() of sorts...

ZakkWylde-

New Member
Reaction score
14
Is there a native or BJ to go along with the event -- Game is about to saved -- (in JASS) such that it'll alert the players in the game that the game is about to be saved by : <PlayerName> (or defeat the player (and that player ONLY) trying to save the game)?

Currently, I just have something that defeats all players if "The game is about to be saved." I'd like to upgrade that if possible.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
I just looked through NewGens function list, and nothing came up (unless you think [ljass]GetSaveBasicFilename()[/ljass] counts, but I have no idea what it does).
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
JASS:
scope savedetection initializer init
    
    globals
        private trigger t = CreateTrigger()
    endglobals

    function actions takes nothing returns nothing
        call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, GetPlayerName( GetTriggerPlayer() ) + &quot; has saved the game.&quot; )
    endfunction

    function init takes nothing returns nothing
        call TriggerRegisterGameEvent( t, EVENT_GAME_SAVE)
        call TriggerAddAction( t, function actions )
    endfunction
endscope


This should work, wrote it out of the back of my hand so I'm not sure if there are syntax errors. It does not boot the player, just shows a message who saves the game.
 

Azlier

Old World Ghost
Reaction score
461
I don't think there's a triggering player with game save events, call me crazy.

I think that's the issue here.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
JASS:
scope savedetection initializer init
    
    globals
        private trigger t = CreateTrigger()
    endglobals

    function actions takes nothing returns nothing
        call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, GetPlayerName( GetTriggerPlayer() ) + &quot; has saved the game.&quot; )
    endfunction

    function init takes nothing returns nothing
        call TriggerRegisterGameEvent( t, EVENT_GAME_SAVE)
        call TriggerAddAction( t, function actions )
    endfunction
endscope


This should work, wrote it out of the back of my hand so I'm not sure if there are syntax errors. It does not boot the player, just shows a message who saves the game.

Most likely, that will display null.
 

ZakkWylde-

New Member
Reaction score
14
>[LJASS]GetSaveBasicFilename[/LJASS]
Could you make it save with a different filename for each palyer? :p

Hrmm...would this help me kick the person BEFORE he/she saves? ...

---

On second thought...if any of you have played Murloc Slide, if you try to save the game, it closes Warcraft 3--instantly (for everyone in the game)...does that require a force/how could one do that?
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Use Themis's trigger, but instead of trying to display anything: use an infinite loop, end the game, display a corrupt model, try to change a unit's colour to something like 24, anything that ends the game really.

Edit: I had some grammar errors...
 

Jesus4Lyf

Good Idea™
Reaction score
397
Theory #9:
Can you detect when the player enters the save game menu, and use ForceUIKey to type their name into the box and hit save, and then compare to it and kick them? :O

Azlier style suggestion. :D

But actually, could ForceUIKey be used to detect who is saving, by using it in an on unit save event? Maybe WC3 will not allow hotkeys for the player who started to save or something.
 

ZakkWylde-

New Member
Reaction score
14
J4L's suggestion (Azlier style) is pretty nifty =D.

But I'm not sure it would actually prevent the game from being saved. My whole goal here is so that no one can reload the file and start playing from there or disrupt the game by pausing (because pausing/saving in the middle of an intense level of sliding/ice mazing to throw someone off is the worst).

As to Renedaru's suggestion, I wasn't looking to fatal error crash the game.

What I have in mind (and what murloc slide looks like after saving) is as if I hit alt+f4+x (for every player in the game)
I'm not sure how ForceUIKey works, but if anyone sees something like this as possible, I'd love to know.

EDIT: Upon implicit request by Azlier, name changed from Aziler to Azlier :p
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
J4L's suggestion (Aziler style) is pretty nifty =D.

But I'm not sure it would actually prevent the game from being saved. My whole goal here is so that no one can reload the file and start playing from there or disrupt the game by pausing (because pausing/saving in the middle of an intense level of sliding/ice mazing to throw someone off is the worst).

As to Renedaru's suggestion, I wasn't looking to fatal error crash the game.

What I have in mind (and what murloc slide looks like after saving) is as if I hit alt+f4+x (for every player in the game)
I'm not sure how ForceUIKey works, but if anyone sees something like this as possible, I'd love to know.

Forcing an infinite loop will close the window, and in some cases not even show an error message.
 

Azlier

Old World Ghost
Reaction score
461
>J4L's suggestion (Aziler style) is pretty nifty =D.

The law holds true. My name cannot be spelled.

More importantly, I don't use smilies in my suggestions. Nor do I suggest stupid stuff (most of the time).

>But actually, could ForceUIKey be used to detect who is saving

I don't see anyway how such a thing could work. The game pauses for everyone while saving.
 

ZakkWylde-

New Member
Reaction score
14
Azlier (or anyone else),
Do you know, then, how I can utilize ForceUIKey...I am incredibly unfamiliar with Force.

Also, if anyone has any resources about Forces/ForceUIKEY that s/he would like to bring to my attention (or to others' on this thread) I'd be glad to go through them and better my knowledge.
 

Azlier

Old World Ghost
Reaction score
461
ForceUIKey merely forces the game to act as if the player has pressed that key, but it only works with unit hotkeys. Like, if a player has a Paladin selected (assuming the Paladin has Holy Light trained), ForceUIKey("T") will activate the Holy Light targetter.

ForceUIKey can also be used for stuff like click detection, but that's a more advanced subject.
 

eXirrah

New Member
Reaction score
51
You may not be able to detect when a player saves the game, but you can
develop another solutions except crashing the game.
If it is a sliding game then just move all the player's unit to the beginning when
someone tries to save/load the game.
 

Azlier

Old World Ghost
Reaction score
461
But then it's abusable in a way beneficial to the player.
 

ZakkWylde-

New Member
Reaction score
14
Can you ForceUICancel (or whatever it is) to stop that person from saving...? hrmm

but yeah, eXirrah, that idea may not work, especially if someone's almost at the end...saving it and returning everyone's slider to the beginning would be as abusable (if not more detrimental than what I want to prevent).

Now is it possible to put the save on "wait"...?
I'm not sure if you could combine that with
EVENT_GAME_ABOUT_TO_BE_SAVED (or whatever that is xD)
...then call TriggerSleepAction(100000000) or something to that effect...?

and also, I don't mind crashing the game (as a last resort). I'd just like to know how it appears that one hits alt+f4+x instead of fatal error.

NOTE: Can you force alt+q+q (it's almost a hotkey, right? :D)
 

Azlier

Old World Ghost
Reaction score
461
>NOTE: Can you force alt+q+q (it's almost a hotkey, right?)
No.

>EVENT_GAME_ABOUT_TO_BE_SAVED
No.

>Can you ForceUICancel (or whatever it is) to stop that person from saving...?

Yes. Fire ForceUICancel every 0.005 seconds. Now you can't even quit the map. Or use spellbooks. Or target abilities.

>Now is it possible to put the save on "wait"...?
No.

>and also, I don't mind crashing the game
No.

>:D
No.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Maybe try to use the sync natives functions, using game cache, in the GetHost fashion way.
I mean the first player would be the saver (or not) ?

It won't prevent saving, since synchronise data takes some time (should be 0.5 s or so).
It needs a test (or not).

Fire ForceUICancel every 0.005 seconds
I don't believe ForceUICancel/Key are enough fast to allow this kind of stuff.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top