• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to 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

  • Prevent SP Demo.w3x
    16.7 KB · Views: 71
Level 12
Joined
Feb 22, 2010
Messages
1,115
You are doing extra work anyway, you can just use this:


  • Events
    • Map initialization
  • Conditions
  • Actions
    • Custom script: call Cheat("SomebodySetUpUsTheBomb")
 

EdgeOfChaos

E

EdgeOfChaos

Haha, that's a great way of doing it actually. Both of those are better, thanks!
 
Status
Not open for further replies.
Top