Ok, I'm doing a map right now that, even if I say so myself, is KILLER. The only problem is, because of some of it's features, it can't be played in single player very well.
So I'll just cut to the chase: Anyone know any good ways to detect (with triggers) if a game is single player mode or not? Note the distinction: Not single player as in only one player, but single player mode as in not a Bnet or LAN game. I want to allow solo playing, just not in single player mode.
I made the mistake in Kill Me of allowing that, and thus the interactive scene with the center view made it frustrating for people to get by in single player (who didn't know better). I don't want to repeat that mistake.
| Trigger |
| Players: |
| ¤ Human Players |
| Conditions: |
| ¤ Always |
| Actions: |
| ¤ Set deaths for unit to add 1 for 'human players' |
| Trigger |
| Players: |
| ¤ Human Players |
| Conditions: |
¤ Elasped Time is at least 2 seconds (allows all players to fire)
|
| ¤ Current player suffers exactly 1 death of unit |
| Actions: |
¤ End game in defeat for current Player
|
| ¤ Display Text Single Player is not allowed. |
At the start each player will give himself and the other players one death score. Then each players players score will be equal to the number of players. If theres only one player it only runs once, leaving one death.
I did this in Reflector and Time Up Bound.
Hmm, I meant a way to prevent Single player mode. The map is still playable solo in an empty LAN or bnet game, though. Actually that's how it's intended to be, even though 2 players are also possible (but it lags to hell thanks to all my damn triggers... even on fast connections).
ADDITION:
Hmm, I'm thinking the solution would have something to do with the fact that Center View is a wait blocker in single player mode. I'm just wondering what a good way to exploit the wait blocker effect to tell if its single or not would be.
One idea: Cast a recall on some unit, and if the triggers get to activate before the recall has its effect (meaning a wait blocker took place), the game is single player. That of course relies on the spell occuring in the proper timing, and that game speeds wouldn't affect that at all. That, and the trigger loop without HTs is longer than the recall spell (in all cases).
Bah, you logged off from MSN before I could give you this.
[attachmentid=7455]
Yeah, this comp glitched so I had to reboot. I'll take it home with me to look at it (not at my normal comp).
What method does it use?
These aren't the triggers, but they should work the exact same way:
C:
Always.
A:
Center view at Location 0.
Modify deaths of Unit for Current player: Add 1.
C:
Elapsed scenario time is exactly 0 game seconds.
Curent player has suffered exactly 0 deaths of Unit.
A:
Defeat.
Ok, that should work well enough. Thanks for the help.
*Tuxedo Templar grumbles something about needing home internet
Oh i thought it seemed like a really simple question for Tux to ask.
Oh if what Chu said doesn't seem to work try this.
C:
-Always
A:
-Set Switch
-Center Veiw
-Clear Switch
C:
-Switch is set
A:
-End in Defeat
If the center veiw blocking action is like the wait blocking action then it should allow other triggers to fire before it the first one compleates. Like a wait would be in that situation.
I'm assumeing blizzard refers to a blocking aciton as an action that blocks actions in OTHER triggers. Not just the basic 'this action takes a while so it blocks the others".
About Chu's trigger i'm thinking if it acts like waits and allows the second trigger to fire directly after the center veiw action then the set deaths action wouldn't have ran yet.
Wouldnt this be able to replace all the "anticheat" triggers used in maps?
Yeah, unless your want to allow single player mode but not cheats.
Can you remove crashable units?
If so, make start location in the top left or whatnot, have a crashable, removeable unit in the center and center location on the bottom left. It should scroll over it, crashing the game. But In multiplayer, it would just teleport. After it moves, remove the unit.
But this hasnt been tested -_-
I can think of 2 ways to do anti-single player with crashing, but I don't really want that. I want the map to tell the player they need to play it in an empty multiplayer, and then end in a draw.
Yeah thanks bolt, but I already got the basic idea. This wasn't a terribly difficult problem, IMO.
Hmm, should I post a tutorial in the DB for this? Maybe also for how to prevent multiplayer as well?
yeah you should tux

To prevent multiplayer, only use 1 human...
What about detecting whether or not you have a full house or something, so it would get harder the more people there are. (That case would be for an RPG or team game) Actually try to make one tutorial on detecting how many players are present, somehow.

I already know how to crash people in single player mode but that's very unprofessional and shouldn't ever be used.
That's easy, You use a variation of the First method given.
the more death counts of the 'player #' unit the harder the game is.
I've used this in many of my (unfinished) maps.
QUOTE
Original topic. Thanks to Chu and Bolt for helping.
Note the distinction between Single Player and Single Player Mode. Single player is any game that has only one player, whether its hosted on bnet, an empty LAN game, or under Play Custom in Single Player.
Single Player Mode is any game played under the Play Custom option in Single Player. Certain trigger actions function differently under Single Player Mode, as well as cheat codes being allowed. The following methods allow you to prevent your map from being played under either Single Player or non-Single Player modes.
An example of Playing Mode detection.To prevent single player (for instance), simply use the following two triggers (the switch can be replaced with a counter, if you're the conservative type):
| Trigger |
Players:
|
¤ Current Player
|
Conditions:
|
¤ Always
|
Actions:
|
¤ Set 'Switch 1'.
|
¤ Center view on location 'Anywhere'.
|
¤ Clear 'Switch 1'.
|
| Trigger |
Players:
|
¤ Current Player
|
Conditions:
|
¤ 'Switch 1' is set.
|
Actions:
|
¤ Display text: "You are playing under Single Player mode. This map requires that you play under non-Single Player mode. Simply start an empty bnet or Local Area Network (UDP) game if you wish to play this solo."
|
¤ Wait '7000' milliseconds.
|
¤ Draw game.
|
To prevent multiplayer, simply change the "'Switch 1' is set." condition of the second trigger to "'Switch 1' is cleared.", and modify the text message accordingly (optional).
And there you have it!
There's the tutorial entry in full.
What player is "current player?" Thats not a player.
lol I was thinking to make it a computer player so you don't actually have your screen centered in multiplayer mode. I assume it would still work even if a human doesn't own it.
Current player is just a <fill in the blank> kinda thing. I figure people should figure that out easily enough.
I honestly don't know whether comps with center view would cause a wait block to occur. Somehow I doubt it, as I think the action would simply get ignored (comps don't have screens).
Deserves a test, though.
EDIT- Grr, I should change the Single Player definition to Single Player Game vs. Single Player Mode, now that I went and tried to make those definitions in the first place.
I don't think if you did it for a computer player it would act as a wait. It act's as a wait for players because their screen moves slowly from their fixed point to the location. In multiplayer it's instant.
EDIT: Like Tux just said.

I don't know if it's too late, but i think the answer is very very simple.
(If it's more than 1 player map or you have a spare slot that you didn't use)
Simply have two human slots, let player 1 (or the one with less number out of the two) be the optional player. Let the other player be the one you want ppl to play as. Single player will make you player 1 by default if random start location is checked off. At Lan, the gamer can change his slot to the other player. Now simply make the map only playable on that player. This is exactly like when you try to play protect the queen on signle player, there is no queen.
If you don't get my crappy english....
P1 Human (optional player)
P2 Human (required player)
In Lan you can change slot to P2, then play normally
In signle player you are always P1, thus game doesn't work.
of course you can still make P1 work if P2 is present, thus making it multiple player.
QUOTE(Tuxedo Templar @ Apr 9 2005, 01:56 PM)
Current player is just a <fill in the blank> kinda thing. I figure people should figure that out easily enough.
I honestly don't know whether comps with center view would cause a wait block to occur. Somehow I doubt it, as I think the action would simply get ignored (comps don't have screens).
Deserves a test, though.
[right][snapback]183936[/snapback][/right]
Yeah well i guess if it doesn't work for computer then you should change it to say "Human Player" or something

QUOTE(sdG) @ Apr 10 2005, 11:35 AM)
I don't know if it's too late, but i think the answer is very very simple.
[right][snapback]184704[/snapback][/right]
Yes you are too late. Your answer is flawed because having a required player when you don't have to is bad map making practice. If you would read the thread you would know that the answer was solved and your assistance was not needed! Next time take the time to see what other people, including the person asking the question, has said in the thread. It prevents a lot of spam like yours!
Oh come on chu don't be so harsh. I agree he should have read the thread, but he did post an alternate solution that could work, though not as well.