Author Topic: How do you make a net game use special functions?  (Read 3974 times)

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
How do you make a net game use special functions?
« on: 2008-01-17, 06:02:20 AM »
Don't say use SGDK this time, really, or I'll jump down another well again... (SEE PSEUDO 3D TOPIC) :-* ;)       >:(

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2745
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: How do you make a net game use special functions?
« Reply #1 on: 2008-01-17, 06:47:54 AM »
What's wrong with special functions in a network game?  Are you having problems because only the player sprite can trigger special functions? On player 1's system, player 2 doesn't trigger special functions and on player 2's system, player 1 doesn't trigger special functions -- is that the problem?  Network gaming is very complicated, and I don't think it would be possible to detail all the issues in a single post, but to summarize, you probably have to have a lot of communication about the state of the game in order to make sure both systems are in sync.  You probably have to devise some scheme to transfer inventory and position data for both players.  Maybe then the special functions don't need to be triggered on both ends because the only thing they could affect is the position and inventory anyway.

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: How do you make a net game use special functions?
« Reply #2 on: 2008-01-17, 04:20:19 PM »
I tried every method of tweeking (I avoid scripts that aren't from the Net Game Demo) But I could never make player 2 use dynamic functions...( 2 Global functions that switch between sprites constantly without new inst.) And If I can't do that, can I at least make it pick up items and make the script apply to only 1 multiplayer map?? ;D :-*       >:( :ugly:

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2745
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: How do you make a net game use special functions?
« Reply #3 on: 2008-01-17, 09:27:26 PM »
I don't really remember now the net game demo works, but have you tried combining relevant pieces of the 2 player script with the net game demo script?  I wonder if player 2 was a scripted sprite instead of a normal sprite in the net game demo.  I think scripted sprites don't interact with functions, if I recall correctly.