April 19, 2025, 01:10:51 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Poll

Add /votekick? (lasts 1 round)

yes
- 57 (83.8%)
no
- 11 (16.2%)

Total Members Voted: 59


Pages: 1 [2] 3 4 ... 16

Author Topic: [server-sent plugin] Chat - Console!  (Read 38153 times)

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12531
  • Another one --
Re: [server-sent plugin] Chat
« Reply #15 on: May 05, 2013, 06:57:09 am »

then it is a problematic limitation in the api.
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3421
  • she's never quite as dead as you think
Re: [server-sent plugin] Chat
« Reply #16 on: May 05, 2013, 06:57:53 am »

then it is a problematic limitation in the api.
I know. :P
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

[FR]YB

  • 2013 Haxxy Award Winner
  • *
  • Karma: 28
  • Offline Offline
  • Posts: 643
  • There are 11 people playing holy sh
Re: [server-sent plugin] Chat
« Reply #17 on: May 05, 2013, 06:59:18 am »

only reason they were distracted is because "holy shit chat", they'll stop being excited when they get used to it

also requests
  • Names are teamcolored
  • Teamchat
Team chat may not currently be possible. Well, it's possible, but the API doesn't allow you to send packets to specific clients, so everyone would receive the packets for private team chat. That's probably not a problem, since the plugin would obviously not show messages not meant for your team, but someone could possibly intercept team chat. :U

Quote from: Script PluginPacketSendTo
// Sends a packet for a server-sent plugin to a specific client
// Returns true if successful, false if not
// argument0 - plugin packet ID, passed as argument0 to server-sent plugin upon execution
// argument1 - data buffer to send (maximum size 65535 bytes)
// argument2 - Player object for client to send to

That would be quite heavy, maybe laggy and certainly completely stupid, but you could for each player whose team == myTeam in global.players, PluginPacketSendTo, etc...

Also, I don't understand line 3 :  global.chatPacketID = argument1;
I thought loadserverplugin script only accepted one argument?

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3421
  • she's never quite as dead as you think
Re: [server-sent plugin] Chat
« Reply #18 on: May 05, 2013, 08:29:10 am »

only reason they were distracted is because "holy shit chat", they'll stop being excited when they get used to it

also requests
  • Names are teamcolored
  • Teamchat
Team chat may not currently be possible. Well, it's possible, but the API doesn't allow you to send packets to specific clients, so everyone would receive the packets for private team chat. That's probably not a problem, since the plugin would obviously not show messages not meant for your team, but someone could possibly intercept team chat. :U

Quote from: Script PluginPacketSendTo
// Sends a packet for a server-sent plugin to a specific client
// Returns true if successful, false if not
// argument0 - plugin packet ID, passed as argument0 to server-sent plugin upon execution
// argument1 - data buffer to send (maximum size 65535 bytes)
// argument2 - Player object for client to send to

That would be quite heavy, maybe laggy and certainly completely stupid, but you could for each player whose team == myTeam in global.players, PluginPacketSendTo, etc...
Somehow I managed to forget that I actually implemented PluginPacketSendTo. It wouldn't be slow at all, actually.

Ignore everything I said before, I'm really dumb.

That would be quite heavy, maybe laggy and certainly completely stupid, but you could for each player whose team == myTeam in global.players, PluginPacketSendTo, etc...

Also, I don't understand line 3 :  global.chatPacketID = argument1;
I thought loadserverplugin script only accepted one argument?
I updated the docs in the Medo42/master version of GG2, it now says argument1. But that was done yesterday, so GG2 v2.5.1 has incorrect comments still.
« Last Edit: May 05, 2013, 08:30:37 am by ajf »
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

cmb

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 331
  • Mario Bros
Re: [server-sent plugin] Chat
« Reply #19 on: May 05, 2013, 10:27:57 am »

Nova

  • Seasoned Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1648
  • Personal Text
Re: [server-sent plugin] Chat
« Reply #20 on: May 05, 2013, 11:02:51 am »

Stuff that would be nice:
-Typing bubble (to tell if afk or writing)
-Teamcolors
-Somehow make host-messages clearer.
-Make chat not affect moving, namechanging (ServerMessage.gml, too)
« Last Edit: May 05, 2013, 11:03:37 am by Nova »
Logged

Lorgan

  • Retired Randomizer Mod Developer
  • Resident Miku
  • *****
  • Karma: 28
  • Offline Offline
  • Posts: 3624
    • My own website
Re: [server-sent plugin] Chat
« Reply #21 on: May 05, 2013, 11:05:36 am »

chat shouldn't affect moving
Logged
Unfortunately, turning a section into a communist oppressive regime is not against the forum rules, so there is really nothing we can do.
Quote from: steam
21:08 - Hullusorsa: lorgan, when will you buy us the keys?
21:09 - Lorgan: i'm waiting for greece to collapse so the value of the euro drops
21:09 - Lorgan: not even joking

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3421
  • she's never quite as dead as you think
Re: [server-sent plugin] Chat
« Reply #22 on: May 05, 2013, 11:09:04 am »

chat shouldn't affect moving
it does affect spectating
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

AEF

  • Junior Member
  • **
  • Karma: 120
  • Offline Offline
  • Posts: 128
Re: [server-sent plugin] Chat
« Reply #23 on: May 05, 2013, 05:49:12 pm »

Well then, you've gone and made it très soigné.

Some minor issues:

After dropping the relevant files in the plugins folder, running 'Gang Garrison 2.exe' pops up the following error message.

Quote
___________________________________________
ERROR in
action number 1
of Create Event
for object SplashController:

Error in code at line 8:
   global.chatSprite = sprite_add(argument0+"/ConsoleWindowS.png",2,0,0,0,0);
                                           ^
at position 42: Wrong type of arguments to +.

However, I can ignore and continue as usual without any other issues. Chat seems to work correctly.

Also, chat spilling out of the chat window:


Aside from that, it works very nicely!
« Last Edit: May 05, 2013, 05:50:19 pm by AEF »
Logged

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3421
  • she's never quite as dead as you think
Re: [server-sent plugin] Chat
« Reply #24 on: May 05, 2013, 06:36:09 pm »

After dropping the relevant files in the plugins folder, running 'Gang Garrison 2.exe' pops up the following error message.

Quote
___________________________________________
ERROR in
action number 1
of Create Event
for object SplashController:

Error in code at line 8:
   global.chatSprite = sprite_add(argument0+"/ConsoleWindowS.png",2,0,0,0,0);
                                           ^
at position 42: Wrong type of arguments to +.
Um, it's not a client plugin. It's a server-sent plugin. It's useless and stupid to try to extract it to your Plugins folder.
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Lorgan

  • Retired Randomizer Mod Developer
  • Resident Miku
  • *****
  • Karma: 28
  • Offline Offline
  • Posts: 3624
    • My own website
Re: [server-sent plugin] Chat
« Reply #25 on: May 06, 2013, 01:11:06 am »

why is your font messed up :u

« Last Edit: May 06, 2013, 01:12:35 am by Lorgan »
Logged
Unfortunately, turning a section into a communist oppressive regime is not against the forum rules, so there is really nothing we can do.
Quote from: steam
21:08 - Hullusorsa: lorgan, when will you buy us the keys?
21:09 - Lorgan: i'm waiting for greece to collapse so the value of the euro drops
21:09 - Lorgan: not even joking

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3421
  • she's never quite as dead as you think
Re: [server-sent plugin] Chat
« Reply #26 on: May 06, 2013, 04:43:35 am »

why is your font messed up :u


Maybe Windows's Large Fonts setting breaks it?
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Lorgan

  • Retired Randomizer Mod Developer
  • Resident Miku
  • *****
  • Karma: 28
  • Offline Offline
  • Posts: 3624
    • My own website
Re: [server-sent plugin] Chat
« Reply #27 on: May 07, 2013, 01:28:21 pm »

Alright after many hours of cursing and failing i got this working properly now.
New features:
-better line wrapping (if you use normal font settings at least)
-team chat
-changeable controls (plugin menu)
-shouldn't trigger when writing text in a menu.
-color code
-announces when someone with chat joins
-no longer a required server plugin. (Clients can choose if they want to use it or not)
-host gets a different text color so his messages stand out.

AJF isn't online so it isn't updated yet but it will hopefully be soon. finally done
« Last Edit: May 08, 2013, 08:57:33 am by Lorgan »
Logged
Unfortunately, turning a section into a communist oppressive regime is not against the forum rules, so there is really nothing we can do.
Quote from: steam
21:08 - Hullusorsa: lorgan, when will you buy us the keys?
21:09 - Lorgan: i'm waiting for greece to collapse so the value of the euro drops
21:09 - Lorgan: not even joking

Nova

  • Seasoned Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1648
  • Personal Text
Re: [server-sent plugin] Chat
« Reply #28 on: May 07, 2013, 01:32:15 pm »

 :z6:
Logged

GG2RBY

  • Guest
Re: [server-sent plugin] Chat
« Reply #29 on: May 07, 2013, 01:33:25 pm »

Alright after many hours of cursing and failing i got this working properly now.
New features:
-better line wrapping (if you use normal font settings at least)
-team chat
-changeable controls (plugin menu)
-shouldn't trigger when writing text in a menu.
-color code
-announces when someone with chat joins
-no longer a required server plugin. (Clients can choose if they want to use it or not)
-host gets a different text color so his messages stand out.

AJF isn't online so it isn't updated yet but it will hopefully be soon.
Joe Esposito You're The Best Around
Logged
Pages: 1 [2] 3 4 ... 16
 

Page created in 0.029 seconds with 49 queries.