• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Can u convert this into GUI from JASS?

Status
Not open for further replies.
Level 4
Joined
May 18, 2004
Messages
60
This jass trigger disables single player mode when initiated threw custom game:

JASS:
function isSinglePlayer takes nothing returns boolean
   local gamecache gc=InitGameCache("gc.w3v")
   call StoreInteger(gc,"test","test",9)
   return SaveGameCache(gc)
endfunction

To your map header, then create a variable called "SinglePlayer" or something. Now on map initialization have some custom script run like:
  • Trigger:
  • Custom script: set udg_SinglePlayer = isSinglePlayer()
After it has been set SinglePlayer will be true if the game is in single player mode, false otherwise.

=======================================

Ok, the reason why I'm asking if you can convert that is because when I try to add that into my map I get:


I use WE Unlimited latest version and I have enabled the advanced triggers. Which has added tons of JASS scripts to the map and I think maybe I have to much Jass or something and it won't let me add anymore.

I'm trying to make it so you can't play my map threw custom game so it disables cheat codes...

Anyone know of a way to do this as a GUI?
 
Level 4
Joined
May 18, 2004
Messages
60
Ok, I understand that. Here this will be way easier.

The trigger looks like this:

  • Intro Setup Copy
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Dialog - Clear Intro
      • Dialog - Change the title of Intro to Watch the Intro?
      • Dialog - Create a dialog button for Intro labelled |c00008000Watch|r
      • Set Watch = (Last created dialog Button)
      • Dialog - Create a dialog button for Intro labelled |c00ea0000Skip|r
      • Set Skip = (Last created dialog Button)
      • Wait 1.00 seconds
      • Custom script: if bj_isSinglePlayer then
      • Game - Display to Player 1 (Red), at offset (0.00, 0.00) the text: |c0096ecf5Single Player Mode Detected. Game shutting down. If you want to play this by yourself, play the map in a lan game.
      • Wait 8.00 seconds
      • Game - Defeat Player 1 (Red) with the message: Single Player Mode Not Supported
      • Custom script: endif
      • Game - Display to (All players) for 15.00 seconds the text: |c00afafd8Welcome t...
      • Wait 16.00 game-time seconds
      • Dialog - Show Intro for Player 1 (Red)
      • Trigger - Destroy (This trigger)
So, if this is setup like it is currently, it will wait the 8 seconds if the bj_isSinglePlayer is on or off right?

So, then do I need to do an else function to fire other one?

-EDIT-
So, I tried changing it to a separate trigger that says:

  • Detect Single Player Mode
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Custom script: if bj_isSinglePlayer then
      • Game - Display to Player 1 (Red), at offset (0.00, 0.00) the text: |c0096ecf5Single Pl...
      • Game - Defeat Player 1 (Red) with the message: Single Player Mode ...
      • Custom script: endif
      • Trigger - Destroy (This trigger)
I hosted the game over a lan game and it still kicked me out of the game.....
 
Last edited:
Level 4
Joined
May 18, 2004
Messages
60
It was always firing, but that makes sense if it's for only one person playing. I'm doing a cache trigger someone else suggested and about to test it.

OK!!! He got it to work!! The trigger is the following:

  • Single Player Mode
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Game Cache - Create a game cache from MapName.w3v
      • Game Cache - Store 0.00 as a of a in (Last created game cache)
      • Game Cache - Save (Last created game cache)
      • Game Cache - Clear (Last created game cache)
      • Game Cache - Create a game cache from MapName.w3v
      • Game Cache - Reload all game cache data from disk
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (a is stored as a Real of a in (Last created game cache)) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: |c0096ecf5Single Pl...
          • Wait 8.00 seconds
          • Game - End game and Skip scores
        • Else - Actions
          • Game - Display to (All players) for 15.00 seconds the text: |c00afafd8Welcome t...
          • Wait 16.00 game-time seconds
          • Dialog - Show Intro for Player 1 (Red)
That took forever, but success!! Thanks for helping btw ")
 
Last edited:
Status
Not open for further replies.
Top