Nexuiz Classbased Mod Test Release

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

Postby Psychcf » Fri Jun 19, 2009 12:15 pm

Sven wrote:hmm svn bug...

@ Psychcf: give the soldiers infinite incinctble , the electroballs from the medic can heal when a teammate touch and the normal electro shot should look like the phaser and slows enemies down too, the grenades from the engineer...the secondary shot shouls just sink to ground with lifetime of 5min could be the mines ...the primary just can disarm the enemy's mines,
...


Well, I plan on making separate guns for all of those, just to keep everything maintainable.
Psychcf
Forum addon
 
Posts: 1554
Joined: Sun Dec 03, 2006 11:38 pm
Location: NY, USA

Postby Flying Steel » Fri Jun 19, 2009 5:52 pm

Psychcf wrote:
Sven wrote:hmm svn bug...

@ Psychcf: give the soldiers infinite incinctble , the electroballs from the medic can heal when a teammate touch and the normal electro shot should look like the phaser and slows enemies down too, the grenades from the engineer...the secondary shot shouls just sink to ground with lifetime of 5min could be the mines ...the primary just can disarm the enemy's mines,
...


Well, I plan on making separate guns for all of those, just to keep everything maintainable.


Would guns work better for those roles than deployables?
Flying Steel
Keyboard killer
 
Posts: 623
Joined: Fri May 08, 2009 9:13 pm

Postby Sven » Mon Jun 22, 2009 6:10 pm

today i played around in the engine and modded your mod
(made a new class, the god class xD unlimited ammo and good weapons:laser,shotgun, rl, nex, crifle and mortar and should get unlimited invincible and strength but the life should decrease every time and only if he make frags he get hp to stay alive and the class is chooseable in the limbo-menu)

...its only for myself to learn qc :P but i can give you the code if you want xD

but cant compile anymore:

Source file: progs.src
outputfile: ../../progs.dat
compiling ../common/util-pre.qh
compiling sys.qh
compiling pre-builtins.qh
compiling builtins.qh
compiling extensions.qh
[...]
compiling w_tuba.qc
compiling t_items.qc
compiling cl_weapons.qc
compiling cl_impulse.qc
compiling ent_cs.qc
compiling classbased.qc
in function cb_getmaxh (line 4),
classbased.qc:95: error: "" - not a name

************ ERROR ************
Errors have occured

Error in classbased.qc on line 95


there is nothing, what i can delete
Sven
Alien trapper
 
Posts: 315
Joined: Sun Jun 01, 2008 8:38 am
Location: Berlin; Germany

Postby Sven » Mon Jun 22, 2009 6:31 pm

found the problem:
false:
Code: Select all
{
   local string maxh = strcat("g_balance_classbased_", e.gamerole, "_health_stable");

   return cvar(maxh);


right:
Code: Select all
{
   local string maxh = strcat("g_balance_classbased_", e.gamerole, "_health_stable");

   return cvar(maxh);
}


i forgot the "}" at the end xD
Sven
Alien trapper
 
Posts: 315
Joined: Sun Jun 01, 2008 8:38 am
Location: Berlin; Germany

Postby Mr. Bougo » Mon Jun 22, 2009 7:37 pm

Err wow, defining a variable this way defines a constant.

Why not simply use
Code: Select all
cvar(strcat("g_balance_classbased_", e.gamerole, "_health_stable")) ??


Else, what you want is to first declare the variable, then set it.

Code: Select all
local string maxh;
maxh = strcat("g_balance_classbased_", e.gamerole, "_health_stable");


(I have no idea what happens if you define a variable the way you did inside a function... Maybe it works, maybe it doesn't. Who knows :P)
Meh.
Mr. Bougo
Keyboard killer
 
Posts: 760
Joined: Mon Sep 10, 2007 3:29 pm

Postby Psychcf » Mon Jun 22, 2009 8:34 pm

Mr. Bougo wrote:Err wow, defining a variable this way defines a constant.

Why not simply use
Code: Select all
cvar(strcat("g_balance_classbased_", e.gamerole, "_health_stable")) ??


Else, what you want is to first declare the variable, then set it.

Code: Select all
local string maxh;
maxh = strcat("g_balance_classbased_", e.gamerole, "_health_stable");


(I have no idea what happens if you define a variable the way you did inside a function... Maybe it works, maybe it doesn't. Who knows :P)


I just felt like that would make it hard to read, so I made a local variable to put the name of the maxh cvar in, so I can break it up into several lines. Local variables don't spill into the global namespace, so it should be fine, since the GC will just clean it up once the function is done executing.

I'm not the best at quakeC, so correct me if I'm wrong.
Psychcf
Forum addon
 
Posts: 1554
Joined: Sun Dec 03, 2006 11:38 pm
Location: NY, USA

Postby admax88 » Mon Jun 22, 2009 9:46 pm

Psychcf wrote:
Mr. Bougo wrote:Err wow, defining a variable this way defines a constant.

Why not simply use
Code: Select all
cvar(strcat("g_balance_classbased_", e.gamerole, "_health_stable")) ??


Else, what you want is to first declare the variable, then set it.

Code: Select all
local string maxh;
maxh = strcat("g_balance_classbased_", e.gamerole, "_health_stable");


(I have no idea what happens if you define a variable the way you did inside a function... Maybe it works, maybe it doesn't. Who knows :P)


I just felt like that would make it hard to read, so I made a local variable to put the name of the maxh cvar in, so I can break it up into several lines. Local variables don't spill into the global namespace, so it should be fine, since the GC will just clean it up once the function is done executing.

I'm not the best at quakeC, so correct me if I'm wrong.


That might have been my line of code there. I'm rather new to quakec so I could be totally off base, but how can that be a constant if it depends on the value of variable (e.gamerole)?

My impression of quakec was that a line of code like that only defines a constant outside of a function. But I don't know that for certain, just a feeling.
admax88
Newbie
 
Posts: 5
Joined: Sun May 24, 2009 12:34 am

Postby Mr. Bougo » Tue Jun 23, 2009 12:41 pm

The 1st rule of thumb for QuakeC is: Remember: this language sucks

That "local" thing is a synonym for "". Yeah, it means nothing. Its only point is to be able to use an IDE in C mode for QuakeC :P
Also, as I said, I have no clue how it behaves with this definition syntax inside of functions, but I'd expect either nothing special, or unpredictable behaviour :P
Meh.
Mr. Bougo
Keyboard killer
 
Posts: 760
Joined: Mon Sep 10, 2007 3:29 pm

Postby Psychcf » Tue Jun 23, 2009 1:39 pm

Mr. Bougo wrote:The 1st rule of thumb for QuakeC is: Remember: this language sucks

That "local" thing is a synonym for "". Yeah, it means nothing. Its only point is to be able to use an IDE in C mode for QuakeC :P
Also, as I said, I have no clue how it behaves with this definition syntax inside of functions, but I'd expect either nothing special, or unpredictable behaviour :P


WHAT?! THAT'S SO IDIOTIC!

wow, quakeC does suck.
Psychcf
Forum addon
 
Posts: 1554
Joined: Sun Dec 03, 2006 11:38 pm
Location: NY, USA

Postby tZork » Tue Jun 23, 2009 2:15 pm

You think that's bad? You got one serious headache coming your way when you find the really dumb shit abt QuakeC. :twisted:
HOF:
<Diablo> the nex is a "game modification"
<Diablo> quake1 never had a weapon like that.
<Vordreller> there was no need for anything over 4GB untill Vista came along
<Samua>]Idea: Fix it? :D
<Samua>Lies, that only applies to other people.
tZork
tZite Admin
 
Posts: 1337
Joined: Tue Feb 28, 2006 6:16 pm
Location: Halfway to somwhere else

PreviousNext

Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 1 guest

cron