[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - ScratchCSQC?

ScratchCSQC?

Discuss CSQC related programming.

Moderator: InsideQC Admins

ScratchCSQC?

Postby JasonX » Tue Apr 07, 2015 11:56 pm

I was wondering how nice would it be to have a project like ScratchQC, but aimed at CSQC features and modern engines. Specially when dealing with MP stuff, like vweaps. Any guru up to it? :D
JasonX
 
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

Re: ScratchCSQC?

Postby Spike » Wed Apr 08, 2015 4:57 am

hey, don't look at me. I'm too lazy to faff around re-writing code, and too lazy to add lots of animations to models too.
besides, most csqc is from scratch anyway. :P
but yeah, a modern full from-scratch mod is kinda needed. the issue, however, is exactly how modern it should be - that stuff can be really fiddly.

I believe shpuld's work-in-progress nba2 mod is from scratch, but its not exactly regular deathmatch. its been a while since he mentioned it too.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: ScratchCSQC?

Postby Shpuld » Thu Apr 09, 2015 7:46 am

As Spike mentioned, I have a FTEQW only full scratch base (both server and client), that I've used for mobster massacre, new nba and also this bullet hell game I'm working on. I have it on github but it's still a "work in progress" version, buggy code, a lot of missing but planned features, not completely clean either. Still I'd say it's useful especially if you're a CSQC newbie and don't know how to do it yourself.

Please also note the description, I haven't put any of the temprary art assets I have up, so you'll need to replace "player.iqm", "pistol.iqm", etc... or rip a lot of the stuff out if you want.

EDIT: also worth mentioning, since it's from scratch, the GPL doesn't apply to it, so I decided to put it under MIT, which should be much more attractive to people who might want to work on more commercial projects and open QC isn't a good option.
User avatar
Shpuld
 
Posts: 104
Joined: Sat Feb 13, 2010 1:48 pm

Re: ScratchCSQC?

Postby toneddu2000 » Thu Apr 09, 2015 11:08 am

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: ScratchCSQC?

Postby Seven » Mon Jun 15, 2015 9:03 pm

Hello,

I have a question regarding csqc and didnt want to start a new thread, so I picked this one. I hope you do not mind.

My question is:
In ssqc you can check which .worldtype the currently played map is via:
if (world.worldtype == 0)
{
do something... this is a medieval map!
}



But how would you do this in csqc ?
I added this into csqc´s defs.qc:
entity world;
.float worldtype;


But when I use something like I would use in ssqc (shown above), it doesnt work.
I do not know what "world" is called in csqc and I do not know how .worldtype can be checked in csqc.
Can someone give me the necesarry code for this check ?

Thank you very much for your help in advance.

0: medieval
1: metal
2: base
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: ScratchCSQC?

Postby toneddu2000 » Mon Jun 15, 2015 10:16 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: ScratchCSQC?

Postby Spike » Tue Jun 16, 2015 5:33 am

in CSQC_WorldLoaded, you can call getentitytoken a few times to parse the client's version of the entity lump / .ent file. this can be done without any ssqc changes. however, I do not believe this works in DP.
alternatively you can do this in ssqc: localcmd(sprintf("serverinfo wt %g\n", world.worldtype)); inside your worldspawn function, and worldtype = stof(serverkey("wt")); in your csqc. again, this will not work in DP.
alternatively you can use writebytes as toneddu2000, in order for it to work in DP, you will need to use MSG_ONE, and to hack at svc_tempentity. this will not work in saved games unless you use nosave hacks to detect when the game was saved etc (in fte, you would send from a sv_parseclientcommand 'enablecsqc' handler, to determine whenever the client's csqc has [re]started, while in dp you do not known when the client itself is up and running).
alternatively you can do a stuffcmd(self, sprintf("//worldtype %g\n", world.worldtype)); and scan for that prefix inside CSQC_Parse_StuffCmd. again, this will not normally work in saved games without extra work as described above.
alternatively you could use globalstat from worldspawn, along with a global that contains your value. however, globalstat does not exist in dp, but the server does at least have a chance of restoring the value automatically in saved games.
the penultimate option is clientstat as toneddu2000 described. logically this is the simplest method I can think of that will work in dp and should also persist in saved games - assuming the server remembers the mappings on load.
the final option is to use SendEntity. the server will automatically resend the entity when the game is loaded. you can add all sorts of other fields too, you can send strings without worrying about length truncations (unlike dp's stats). however, to resend the entity the entity must be within the client's pvs, and dp does not provide you with the ability to ensure this is always the case, unless you reuse the player's entity for this purpose.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: ScratchCSQC?

Postby Seven » Tue Jun 16, 2015 2:45 pm

Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: ScratchCSQC?

Postby Spike » Tue Jun 16, 2015 3:09 pm

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: ScratchCSQC?

Postby Spike » Tue Jun 16, 2015 3:41 pm

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: ScratchCSQC?

Postby Seven » Tue Jun 16, 2015 4:00 pm

Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: ScratchCSQC?

Postby Spike » Tue Jun 16, 2015 4:33 pm

so use this then:
void(float num, float type, .float fld) clientstatf = #232;
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: ScratchCSQC?

Postby Seven » Tue Jun 16, 2015 6:47 pm

Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: ScratchCSQC?

Postby toneddu2000 » Tue Jun 16, 2015 10:53 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: ScratchCSQC?

Postby Spike » Wed Jun 17, 2015 8:12 am

@seven:
fteqcc should be able to compile smc again.
you will need to remove the non-breaking-spaces that your code seems to have accumulated from somewhere, as non-ascii chars are no longer ignored.

make sure that your csqc's getstatf builtin is #331, and not #330 (because EV_FLOAT+getstati is a _serious_ wtf found in a certain csqc mod targetted at DP).

@toneddu2000:
there is no practical difference between 32bit and 64bit qccs - it refers to the instruction set the compiler executes, not what it generates.
when it comes to windows, I tend not to bother with 64bit on account of both microsoft and third parties not supporting it so well.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Next

Return to CSQC Programming

Who is online

Users browsing this forum: No registered users and 1 guest