Author Topic: The reprobator's fred noobsih question emporium  (Read 12429 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: The reprobator's fred noobsih question emporium
The key-pressed SEXP has never worked and possibly may never work in multiplayer. The problem is the whole server/client issue again. All SEXPs run on the server, the client never even enters that section of the code at all. When a SEXP is fixed to work in multiplayer it means that the server sends a notification to the client telling it that the server has done something and that the client should do the same thing too. So as you can see everything SEXP related is basically a case of the server telling the client what to do.

This is an issue with key-pressed as the server doesn't have the information needed in order for key-pressed to work. It only knows which keys have been pressed on the server. If the host is running the server that means only the player on the server's keys are processed. In the case of a standalone-server it means nobody gets their keys processed, not even the host.

In order for key-pressed to work in multiplayer the server needs to have all the information it needs already present when the SEXP is checked. Now I could simply fix it so that the players send all their data to the server every key-press but I'm worried about the sheer amount of data that would involve sending. As a matter of fact, I was looking into a solution yesterday of having the server notify the clients which key-presses it is interested in and having them send information back only if one of those particular keys is pressed.

While I might be able to code that, I'm currently busy with Diaspora stuff now and it will be a week or two at the very least before I have time to look at it again.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 
Re: The reprobator's fred noobsih question emporium
I see, well that's really nice from you to fixed that, we do not plan to release anything before 6 mounth at least anyway so you do what you have to do, i have no problem with that :)
However one more question , if i understand what you said, it should have worked, when i made my test i host the server (player/Server ie not dedicated ) and played as alpha1, or i guess the game by default do not treat key pressed in multiplayer.

For those kind of script i wonder if a comm like menu (done in lua? ) called by a common key would not be better than waiting for a key to be pressed (as most of key is binded by default) i mean it bugs me a little to "override" an existing key, if i wanted to make for exemple a script that transofrm my target to an electric sheep (why e sheep i do not know :p ) by pressing b for exemple well...
Anyway it is certainly not a real issue as most fredders untill now could do it with key pressed.
$Formula: ( every-time
   ( has-time-elapsed "0" )
   ( Do-Nothing
   )
   ( send-message
      "#Dalek"
      "High"
      "Pro-crasti-nate"
   )
   )
)
+Name: Procratination
+Repeat Count: 99999999999
+Interval: 1