• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Single Player Detector

Status
Not open for further replies.
Level 10
Joined
Dec 15, 2012
Messages
650
  • Conditions
    • (Player 1 (Red) slot status) Equal to Is playing
    • (Player 1 (Red) controller) Equal to User
This checks the status of Player 1 (Red) is playing or not and it does not detects Player 1 (Red) is playing the game in Single Player mode, thanks for your reply.
In WE go to Scenario -> Player Properties. You can name players there, set which player is user, which one is computer, etc.
Maybe I didn't explain my problem as well...:vw_death:
my game can only be played in Local Area Network mode:ogre_hurrhurr:
 
Level 10
Joined
Dec 15, 2012
Messages
650
Oh...I finally understand that...
:fp: Is this a stupid question >?<

EDIT :
Except that this is not how it's done..
I know because it IS possible to play gaias solo, as long as you use the local area network thing.
not really, I afraid some trigger actions may cause errors in Single Player.
Maybe they check one of the map flags?(Such as whether cheats are allowed)
Checks Map flag !? What's that ?
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
It's quite simple, really.
Game caches don't really work on battle.net, so you can do stuff with them and see if it did something.
If it loaded correctly, it must be single-player. If it didn't, then it must be multi-player (LAN or battle.net).

  • Actions
    • Custom script: if ReloadGameCachesFromDisk() then
    • Game - Display to (All players) the text: Single-Player
    • Custom script: else
    • Game - Display to (All players) the text: Multi-Player
    • Custom script: endif
You can use this with a boolean, like this:
  • Actions
    • Set IsSinglePlayer = False
    • Custom script: if ReloadGameCachesFromDisk() then
    • Set IsSinglePlayer = True
    • Custom script: endif
so you've got it stored.

This also works if there is only 1 player in the game.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
not really, I afraid some trigger actions may cause errors in Single Player.

Not really, errors are either always or in multiplayer.

It's quite simple, really.
Game caches don't really work on battle.net, so you can do stuff with them and see if it did something.
If it loaded correctly, it must be single-player. If it didn't, then it must be multi-player (LAN or battle.net).

  • Actions
    • Custom script: if ReloadGameCachesFromDisk() then
    • Game - Display to (All players) the text: Single-Player
    • Custom script: else
    • Game - Display to (All players) the text: Multi-Player
    • Custom script: endif
You can use this with a boolean, like this:
  • Actions
    • Set IsSinglePlayer = False
    • Custom script: if ReloadGameCachesFromDisk() then
    • Set IsSinglePlayer = True
    • Custom script: endif
so you've got it stored.

This also works if there is only 1 player in the game.

This must be it.
 
Level 10
Joined
Dec 15, 2012
Messages
650
you can just do this with custom script and a boolean variable. Ex:
  • Custom script : set udg_SinglePlayerMode = ReloadGameCachesFromDisk()[/Quote]
  • Then TRUE = is playing game in [i]Single Player mode[/i] ?
  • and FALSE = is playing game in [b]Local Area Network[/b] ?
  • __________________________________
  • [center]:goblin_yeah: :goblin_good_job:[/center]
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
JASS:
function IsSinglePlayer takes nothing returns boolean
    return ReloadGameCachesFromDisk()
endfunction

ap0calypse learned it from me :D
The function I normally use for this also works, but you had to create a game cache for that, making it not as good as yours :D.
So thanks for this method :).
  • Game Cache - Create a game cache from SinglePlayer.w3v
  • Custom script: Set IsSinglePlayer = SaveGameCache(bj_lastCreatedGameCache)
Also, nice catch with the short version (set var = native), better than the ITE.
 
Level 10
Joined
Dec 15, 2012
Messages
650
The function I normally use for this also works, but you had to create a game cache for that, making it not as good as yours :D.
So thanks for this method :).
  • Game Cache - Create a game cache from SinglePlayer.w3v
  • Custom script: Set IsSinglePlayer = SaveGameCache(bj_lastCreatedGameCache)
Also, nice catch with the short version (set var = native), better than the ITE.
better.Awwwww you guys make me so dizzy:ogre_rage:
:fp: Will a game cathe make my game unable to be saved ??
 
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set pg2 = (All players matching (((Matching player) controller) Equal to User))
      • Set int = (Number of players in pg2)
      • Game - Display to pg2 for 10.00 seconds the text: ((String(int)) + players confirmed.)
      • Custom script: call DestroyForce(udg_pg2)
      • Custom script: set udg_pg2 = null
Ofc, if int=1 its a single player.
 
we have given him the best solution best_player_88
again,you are not the best

Its just an account name based on warcraft 3 gaming, not on world editor knowledge, and about what the other answered, I never read those, I skipped right to the last massage so I could advice my own, uniqe version of doing it. "The one thing you allways have to keep in mind is that function has more tha one way to be done" as my teacher says. I never said I am better than you and you should't feel offended about my account name, you can change your accaunt name to "best gui knower" if it makes you feel good.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Almia said:
^ really?
But why would Nestharus do such thing if it needs game cache?
You don't want to do that, because your method is better? :D

Xian_1998 said:
Aren't it should be
  • Custom script : set udg_IsSinglePlayer = SaveGameCache(bj_lastCreatedGameCache)
Oh yes, that is correct.

we have given him the best solution best_player_88
again,you are not the best
WHAT IF, in the ranking of all the good players, he is ranked 88th?
That means he's not saying he's the best, but he's in the top-100 (still a notable achievement).

about what the other answered, I never read those, I skipped right to the last massage so I could advice my own, uniqe version of doing it.
Please don't do that. Reading the thread is important.
How do you know it's a "unique version of doing it" if you don't read the thread, huh?
Also, people who post something that has already been answered is really annoying.

Stop feeling jealousy towards someone who has 253 less reputation points than you, that doesn't even makes sence.
What about me? With my mighty 1229 rep more! Huahua!
But really, rep doesn't mean all that much. It just means I've been around (read: active) for quite some time and post a lot of useless things that people seem to like for some unknown reason.
Rada has done more than I have, yet his rep is lower than mine.
 
Status
Not open for further replies.
Top