• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Prevent playing "Single Player" mode, but allow solo LAN play.

Status
Not open for further replies.

EdgeOfChaos

E

EdgeOfChaos

So, this code is very simple and I did not invent it, but it seems that not many RPG makers know how to do it, so here it is.

JASS:
  call Cheat("greedisgood 1000000")
    call TriggerSleepAction(0.01)
    if ( GetPlayerState(GetLocalPlayer(), PLAYER_STATE_RESOURCE_GOLD ) == 1000000 ) then
        call CustomDefeatBJ( GetLocalPlayer(), "No Single-Player-Mode!" )
    endif

And a short tutorial for GUI-ers:

1. Make a new Trigger
2. Add Melee Initialization event
3. Go to Edit -> Convert to Custom Text
4. You'll see a function like this, at the very top of the code.
JASS:
function Trig__TRIGGERNAME__Actions takes nothing returns nothing
endfunction
5. Copy paste the above code between the 2 lines, like so.
JASS:
function Trig_TRIGGERNAME_Actions takes nothing returns nothing
    call Cheat("greedisgood 1000000")
    call TriggerSleepAction(0.01)
    if ( GetPlayerState(GetLocalPlayer(), PLAYER_STATE_RESOURCE_GOLD ) == 1000000 ) then
        call CustomDefeatBJ( GetLocalPlayer(), "No Single-Player-Mode!" )
    endif
endfunction
And you're done.
Obviously this assumes that you don't start out any player with 1 million gold.
 

Attachments

You are doing extra work anyway, you can just use this:


  • Events
    • Map initialization
  • Conditions
  • Actions
    • Custom script: call Cheat("SomebodySetUpUsTheBomb")
 
Haha, that's a great way of doing it actually. Both of those are better, thanks!
 
Status
Not open for further replies.
Back
Top