Page 1 of 1
Differentiate between single player and multiplayer?
Posted: Mon Feb 05, 2007 4:10 pm
by Broadus
I'm modding on the PSP, and I've learned that single player runs much faster than multiplayer. Every level runs really fast with large amounts of AI per team on single player, but on multiplayer, a lot of levels go way too slow.
So, I need to make levels be able to tell the difference between a single player game and a multiplayer game, so on single player I can set it to have more AI and on multiplayer I can set it to have less AI.
Anyone know how I can put a script in a level to tell the difference between single player (a game with one player) or multiplayer (a game with more than one player)?
I'd basically say "if single player, SetNumBots to 32, if multiplayer, SetNumBots to 24." Obviously, real scripts wouldn't look like that.
Posted: Mon Feb 05, 2007 4:21 pm
by Ace_Azzameen_5
Useful for everbody. Please answer if you know.
Posted: Tue Feb 06, 2007 7:27 pm
by Broadus
Come on, you guys can't be telling me there's no way to put a script in a level where one script activates if it's multiplayer, but if it isn't multiplayer, a different script activates. Y'know, "If Multiplayer True, Do This, Else, Do That."
I REALLY need this for PSP multiplayer. Some levels just go too slow on multiplayer, even when they run quite fast on single player.
Posted: Wed Feb 07, 2007 2:00 am
by archer01
I’ve always used ScriptCB_InNetGame() to check if it is a multiplayer game (it returns true or false), but I haven’t a clue if that would work on the PSP.
You could also try the ScriptCB_InMultiplayer() function and see if it works.
Posted: Wed Feb 07, 2007 6:45 pm
by Broadus
Neato!
The PSP multiplayer acts a lot like the multiplayer of the PC... When a player leaves, it simply says that player left the game (rather than shutting down everything like other Ad Hoc games would do), and after the very first game, the host doesn't have to wait for other players to load before he can start playing in any games following after.
Anyway, my point is, that might work. I hope so! I'll try it out when I can, though I have but one PSP myself so I won't be able to try it immediately.
Right now, to say the least, it's capable of telling when it's NOT in multiplayer. I'll see if I can't test the multiplayer tomorrow and report back.
Posted: Thu Feb 08, 2007 1:07 pm
by -Yock-
I belive Zerted is the right guy to help you

Posted: Thu Feb 08, 2007 7:05 pm
by Broadus
Woes and sorrows a thousand fold!
My friend was in the auditorium, away from his backpack for quite a while, and it appears his PSP was stolen! I am now unable to test the multiplayer with the new scripts. That, and my friend is out of $300 in hardware! I can only hope he somehow manages to discover its whereabouts. Though it was stolen, not lost. It's not like some kind soul will return it.
I'll have to release the mod as-is without testing the single player/multiplayer bot count scripts.
Posted: Thu Feb 08, 2007 11:09 pm
by [RDH]Zerted
archer01 is an excellent SWBF2 Lua coder.
I was storing my formatted function list in the modding wiki, but that is now offline...
Here are a two others that may or many not help:
ScriptCB_InNetSession()
ScriptCB_IsNetworkOn()
Posted: Fri Feb 09, 2007 11:36 pm
by Broadus
Hey, turns out my friend had his PSP all along, just buried away deep within his backpack. I sure feel stupid.
Anyway, this means that I can test the multiplayer soon. Hopefully, it'll work!