Site Navigation
QuakeOne News
» Latest News
» News Archives
» QuakeOne Movies

QuakeOne Help
» File Downloads
» Quake Help
» Quake Servers

QuakeOne Community
» Forums
» Chat *new*
» Poll Booth
» Memberlist
» Member Map

Site Info
» Community Rules
» Moderator List

» Buy Quake

Visit QuakeOne.com On Facebook!Visit QuakeOne
on Facebook

Log in
User Name:

Password:

Not a member yet?
Register Now!
Online Users: 362
5 members and 357 guests
Focalor, ijazz, nucas, siger
Most users ever online was 2,542, 06-04-2016 at 12:58 AM.
Go Back Home > Forums > Quake Talk > Quake Central > Parseing Chat in QC Search Forums

Reply
LinkBack Thread Tools
Unread 03-19-2017, 01:34 PM   #1 (permalink)
Enforcer
SpecialBomb's Avatar
USER INFO »
Posts: 98
+/-  Reputation: SpecialBomb is on a distinguished road
Join Date: Dec 2015
Currently: Offline
Parseing Chat in QC

I would like to change my voting system so that players can type "!yes" or "!no" to vote in chat, rather than using impulses with aliases.

I already have an idea to deal with this, but I would like to make sure if there isn't any existing variable I can use.
Reply With Quote
Unread 03-19-2017, 02:00 PM   #2 (permalink)
Chthon
Mr.Burns's Avatar
USER INFO »
Posts: 1,486
+/-  Reputation: Mr.Burns will become famous soon enough
Join Date: Jan 2006
Currently: Offline
Hi SB
I seem to recall that say !yes and say !no are already used for replying to "magic" based votes for map and setting changes on the NYC, Bigfoot, and Damage servers. So you unless you are running your own mod on a different server you may get some unexpected behaviour.
Most basic Quake map voting systems already use yes/no so I'm just curious why do you want to add the exclamation mark (!) instead?

Kind regards
Monty
__________________
Mr.Burns
WWW: QuakeOne | Q1 File Repo | Quake Terminus|EuroQuake, You Tube: QuakeVoid
Servers: flanders.servequake.com | newyork.servequake.com ports 26000-6 & 10 | damage.servequake.com
NEWS : The new Quakeone file repo is now available, so click here to satisfy all your Quake 1 multiplayer needs
Reply With Quote
Unread 03-19-2017, 02:12 PM   #3 (permalink)
Enforcer
SpecialBomb's Avatar
USER INFO »
Posts: 98
+/-  Reputation: SpecialBomb is on a distinguished road
Join Date: Dec 2015
Currently: Offline
The exclamation point is there to specifically say that it is a command. This is standard stuff when you mess around with chatbots on anything, its just to make sure that no one accidentally votes or activates a command.

I could leave it out, but it's just a good habit.
Reply With Quote
Unread 03-19-2017, 03:06 PM   #4 (permalink)
FTEQW Author
USER INFO »
Posts: 1,114
+/-  Reputation: Spike has a spectacular aura aboutSpike has a spectacular aura about
Join Date: Jul 2010
Currently: Offline
Code:
void(string s) SV_ParseClientCommand = { tokenize(s); if(argv(0) == "say" && argv(1) == "!yes") vote_notyes(self); else if(argv(0) == "say" && argv(1) == "!no") vote_notno(self); else clientcommand(self, s); };
__________________
Some Game Thing
Reply With Quote
Unread 03-19-2017, 03:23 PM   #5 (permalink)
The man who sold the world
MadGypsy's Avatar
USER INFO »
Posts: 5,057
+/-  Reputation: MadGypsy has a spectacular aura aboutMadGypsy has a spectacular aura aboutMadGypsy has a spectacular aura about
Join Date: Feb 2011
Currently: Offline
cause we can and I am super bored. This also gave me some reason to bust out the full-size waterproof Bluetooth keyboard that can be rolled up and stuck in your pocket. It's not awesome beyond that. .

Code:
void(string s) SV_ParseClientCommand = { tokenize(s); if(argv(0) == "say") { switch(argv(1)) { case "!yes": vote_notyes(self); break; case "!no": vote_notno(self); break; default: clientcommand(self, s); break; } } };
__________________
X_Michael

Last edited by MadGypsy; 03-19-2017 at 03:29 PM..
Reply With Quote
Unread 03-19-2017, 03:39 PM   #6 (permalink)
Enforcer
SpecialBomb's Avatar
USER INFO »
Posts: 98
+/-  Reputation: SpecialBomb is on a distinguished road
Join Date: Dec 2015
Currently: Offline
Are the above solutions engine ubiquitous/agnostic?
Reply With Quote
Unread 03-19-2017, 03:42 PM   #7 (permalink)
The man who sold the world
MadGypsy's Avatar
USER INFO »
Posts: 5,057
+/-  Reputation: MadGypsy has a spectacular aura aboutMadGypsy has a spectacular aura aboutMadGypsy has a spectacular aura about
Join Date: Feb 2011
Currently: Offline
They are essentially identical solutions... Switch/Case can always be substituted for If/Else in languages that support it BUT to use switch/case you probably HAVE to use FTEQCC to compile. Other than that the code looks pretty vanilla to me.

I opine that you realize the _not(yes/no) functions represent functions you need to write.

Aside - you had me at parsing ... my favoritest thing. It's mildly funny cause I was like "ooooh stuff to parse" and then I was like ::teeth smack:: "This ain't a parse situation, man." You shattered all of my hopes and dreams... Lol
__________________
X_Michael

Last edited by MadGypsy; 03-19-2017 at 03:53 PM..
Reply With Quote
Unread 03-19-2017, 04:10 PM   #8 (permalink)
Enforcer
SpecialBomb's Avatar
USER INFO »
Posts: 98
+/-  Reputation: SpecialBomb is on a distinguished road
Join Date: Dec 2015
Currently: Offline
Ah, okay.

My only question is what tokenize() does, because I can't seem to find any documentation on it.

Also, it seems that you guys haven't totally solved my problem, as I need to somehow get the players command for say. I see how its splitting the string and everything, but I still need to figure out how to actually get that input string for the function.

So, how do look for and obtain the player's say command as a string?

Last edited by SpecialBomb; 03-19-2017 at 04:16 PM..
Reply With Quote
Unread 03-19-2017, 05:43 PM   #9 (permalink)
FTEQW Author
USER INFO »
Posts: 1,114
+/-  Reputation: Spike has a spectacular aura aboutSpike has a spectacular aura about
Join Date: Jul 2010
Currently: Offline
KRIMZON_SV_PARSECLIENTCOMMAND
the server calls SV_ParseClientCommand. the qc handles whatever it wants (with tokenize to parse the string), and calls clientcommand for anything it wants the engine to handle instead.
its quite simple in that regard.
obviously it IS a serverside extension, so requires a server that supports it. pretty much every engine that has qc extensions has that one at least.

mg's version is buggy, and would not allow you to even connect if it were not for hacks in the engine to work around such buggy mods. unfortunately this helps hide the bugs...
just make sure that you call clientcommand for ALL commands that you don't recognise, you can only skip it for things that you actually recognise and know are safe for the engine to ignore - like say commands (ignoring those will merely mute all the players!).
__________________
Some Game Thing
Reply With Quote
Unread 03-19-2017, 08:18 PM   #10 (permalink)
The man who sold the world
MadGypsy's Avatar
USER INFO »
Posts: 5,057
+/-  Reputation: MadGypsy has a spectacular aura aboutMadGypsy has a spectacular aura aboutMadGypsy has a spectacular aura about
Join Date: Feb 2011
Currently: Offline
Why are switch/case statements buggy? I know your compiler accepts them. They are also a very common feature in a shit load of languages.

I really am trying to understand why switch/case would be any different than if/else considering they are practically equivalents of each other.
__________________
X_Michael

Last edited by MadGypsy; 03-19-2017 at 08:35 PM..
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 04:13 AM.


eXTReMe Tracker