The Daily Click ::. Forums ::. Klik Coding Help ::. Easy Lacewing Questions
 

Post Reply  Post Oekaki 
 

Posted By Message

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
27th February, 2010 at 16:18:38 -

I've downloaded the rather excellent example from here:
http://www.create-games.com/download.asp?id=8015

I don't entirely understand how the lobby part works, so I'll probably have to copy it more or less wholesale.
There's just one change I need to make, but I don't know how:

How would I make it so that once two players have joined a game, that game is no longer visible/available to join, to other players? (my game will only support 2 players max.)

 
n/a

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
27th February, 2010 at 17:35:10 -

You might add an event to the clients that sends a message to the Lobby channel when the game starts, and tells the other clients to remove the game from the list. Another event could be added to boot other players if they try to join a full game by testing the number of peers upon connecting. If the number of peers is zero or one, then turn on a flag or something, and then if the number of peers is greater than 1 and that same flag is not already on, then disconnect.

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
27th February, 2010 at 18:06:20 -

Okay, thanks - I'll see if I can figure that out

EDIT: Nope, I'm still not getting anywhere. I guess I'll leave it for now...

Someone should make a "lobby widget" - a subapp that people can just drag & drop into their main game frame, and it runs as a popup window...


Edited by Sketchy

 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
27th February, 2010 at 22:18:14 -

You have 3 players in the lobby, 2 of which are about to join a game made by the 1st.

1st creates game:
when "create game button" clicked:
>send message 'gamename' to subchannel whatever


when peers recieve that message, they will add the name to a list object or whatever

now, peers can join that game by selecting the name and pressing join

this will send another message, also we indicate which game the peer wants to join by putting the game name in a string (we'll use that later):
when "join button" clicked:
>send message "I just joined"+'game name' to subchannel whatever
>set global string a to 'game name'

When theres enough players, the 1st will start the name. Notice theres only 1 peer joined, the second peer haven't joined the game yet.

the 1st player (The one who created the game) presses the start game button. And by that, he sends a message:
when "start game button" clicked:
>send message 'gamename' to subchannel whatever
>next frame


when a peer recieves that message, and their alterable string is == message, they will join the channel and go to next frame:
when message recieved == global string a:
(you could also send a message like 'I left the lobby to play 'game name' or something)
>next frame


when a peer that haven't joined the game recieved that message, we'll delete it from the list.
when message recieved <> global string a:
>list: delete line (Find string exact) 'message recieved'

also, have a disconnect at the end of frame
end of frame:
>disconnect


when the players go to the next frame, they will connect as usual but join the channel 'global string a' (the game name, remember?), this does that only those people
can see each other etc.


If theres something wrong, reply to this message =P just wrote it off the top of my head but thats basicly what I do...
I think I'm going to make that widget you talked about if I can =P

Edited by Solgryn

 
www.Solgryn.org

Image

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
27th February, 2010 at 22:37:51 -

Hey that's my example! Yeah Solgryn pretty much explained it all For zombie swarm though I'm making a custom games lobby like in Halo 3 where you can invite people to your channel and play your own homemade maps/game types. It's gonna use multiple channels (like the lobby I made) and the stack feature to send your maps to the other players. So far you can invite anyone that's in the lobby to your game, talk to them, and they can view the maps

It's like 3 times harder than this lobby maybe I'll most my .mfa when I'm finished

Edited by Sumo148

 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
27th February, 2010 at 22:48:08 -

I also wrote this article a while ago:

http://www.create-games.com/article.asp?id=2104

 
www.Solgryn.org

Image

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
27th February, 2010 at 22:54:02 -

Even though that tutorial was for OINC, it still is pretty much the same exact thing for lacewing. I even added commentary for that example What part don't you understand? I'll try to explain it to you.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
28th February, 2010 at 18:19:15 -

Thanks guys.

Solgryn:
I looked at your article, and tried copying it, but I can't make it work. No games never appear in the list.
The other method you describe is a bit complicated too, with the "start" button and messages about who joined which game.
What's wrong here:
Image

Sumo148:
Having player-names and game-names makes your example very complicated (too complicate dreally), but I think I more or less get it now.
Just the stuff under "lobby refresh" in the "Game Room" frame that I don't understand...

Anyone:
I'm really looking for something as simple as possible.

I want a player (no player names required) to be able to create a game, by entering a name and pressing "create" - in which case they will instantly go to the next frame, and the game name will appear in a list for anyone else playing.
I want other players to be able to join a game by picking the game name from a list amd pressing "join".
Once one player has joined a game (so 2 players total), I want the game to be removed from the list in the lobby.
An exampe would be amazing if anyone has the time...


 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
28th February, 2010 at 18:21:38 -

Where is your "set name" ? I forgot that in my example.. when you connect you need to set your name and then join the channel

I'll make an example sec

Hey I made an example = It works for me:

http://www.solgryn.org/Stuff/Random/LobbyExampleSolgryn.zip

Edited by Solgryn

 
www.Solgryn.org

Image

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
28th February, 2010 at 20:18:13 -

Wow! That's brilliant - thankyou so much
I'll take a look at the code right after the hockey, but it seems to work perfectly.
btw: You should post that in the downloads section - I'm sure it would be helpful to a lot of people.

Edited by Sketchy

 
n/a

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
28th February, 2010 at 23:47:28 -

Solgryn, your example has a huge flaw :/ if a player joins the lobby (after you created a game), they won't be able to see the game that you created. That's what my example fixed with the "Lobby Refresh". During the game, if you're the host you will switch your channel to the lobby and test to see if a new peer connects. If he does, you will send your game information to that peer so he can be updated in the lobby...

Thats why my example seemed more complicated, because it used 2 channels. Also I just used the string parser 2 to split up the string so you can read the game name and the host of the game. It's not that complicated. Solgryn just combined the two using "Username - Game Name"

Edited by Sumo148

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
1st March, 2010 at 17:42:02 -

Big thanks to both of you - I've got a nice little system going now, which is very simple (didn't really need the chat etc) and which works nicely - even if someone enters the lobby after a game has been created

 
n/a
   

Post Reply



 



Advertisement

Worth A Click