Programming three team CTF


I’m stumped on what to do to fix this, this involves ai_cmd.c. I’m adding functions to the bot AI so that way it knows what to do while on the new green team.
I get this in Cygwin because of it:

Here’s what Notepad++ gives me:

Mind helping me out here @KuehnhammerTobias/@zturtleman? I don’t mean to be driving your patience through the roof, @KuehnhammerTobias, but I really do need your help at this point as this is the only thing keeping the first beta of my new mod from compiling.


The output says you missed a } before the else if. at line 1744. This doesn’t mean you really missed the bracket at 1744! Could be somewhere above that line…
Nobody can say you, where you’ve missed the bracket, …
Well, this is why I said it 100 times, it st hard to help you this way, or by posting screenshots of your code. Sorry, I can’t help you with screenshots!
Good luck!


I figured out where it was, & fixed it. Thanks for the help however @KuehnhammerTobias!


How do you suppose you give a function a new member? In this case “cgMedia_t”. The compilation currently errors because it doesn’t have “greenQuadShader”. EDIT: I need to use grep -ri more often… found it.


This one’s a bit more puzzling… I have the } character in there already but it doesn’t wanna for some reason…
Here’s what Cygwin says:

Notepad++ gives me this however:

Any ideas? Could someone help please? Any ideas, @KuehnhammerTobias?


GitHub source for 3wctf is @: if you’re interested.


Line 1717: has an opening brace, but no closing brace. Hmm, I think this won’t work, though, didn’t test the rest of your code in detail yet.


You’re invited to help fix it for me. GitHub’s surely the way to go, isn’t it? Just needs remote tracking & that’s it. I had forgot to modify bg_misc.c to account for the new team (and to try to put back in the original CTF sounds from pak0.pk3). I’ll send it to the page shortly.


No Sir!, I have enough work (and problems) with my own mint-arena fork(s)! Anyways, I hope you’ll succeed!
Nice to see you finally started to work on your 3 Team CTF mod! :thumbsup:


I’ve been working on it for a while now… if any of you have some spare time, I’ll most likely see if I can get it working for all of you, & working good so that way I can help bugtest…


In my sparse sparetime I do some coding, or I play mint-arena. In my sparetime from ‘sparetime coding’, I go fishing or riding my bicyle…
It’s your work, we will see if we can help you. It doesn’t really make sense to bugtest your work for us!


We’ll see when that happens… Oh well, that means we could all bugtest together then.


…sounds somehow weird to me :laughing:


I can’t blame you one bit either :laughing:


Also it seems I try to fix it but it just gets worse… I replaced the ai_cmd.c & I’ll be uploading the bg_misc.c shortly… EDIT: Welp, it’s uploaded.


Uh, I had a look at your current work…,sorry to say, but I think you have some fundamental errors in your coding style. Some operations aren’t possible (allowed) in C, e.g.:

if (x) {
do something
do something else
do something else

isn’t possible. You already have an ‘else’!

Also, have a look at:
This is wrong!
Reads as "eventParm = if team is red than GTS_REDTEAM_TOOK_LEAD else GTS_BLUETEAM_TOOK_LEAD
In other words: = ? something : _something_ reads as if/else
doesn’t work.

You can’t simply copy/paste some code here and there. Simply expand every line with ‘green’ where ‘red/blue’ already is doesn’t work!

You don’t need to deal with ai_cmd for now, it will never work, because you have no ‘green’ goal yet (LTG_GETFLAG)…

Hmm, I don’t want to discourage you but I think you should learn some fundamentals about C programming first!


I’ll upload a replacement to that that should fix that error, @KuehnhammerTobias. Thanks for reminding me.


Also, I would like to have the white team display the default player skins/models by having the game parse the files for them, except in special cases where the player skin for that player must be used, thus inside whatever player model they are a skin of would be used for the team skin instead. For example, Daemia uses Any idea on how I could do that, @KuehnhammerTobias/@zturtleman?


@KuehnhammerTobias, I fixed up g_team.c for ya - sorry it wasn’t shortly. Real life got in the way…

	eventParm = ( otherTeam == TEAM_RED ) ? GTS_REDTEAM_TOOK_LEAD; 
	eventParm = ( otherTeam == TEAM_BLUE ) ? GTS_BLUETEAM_TOOK_LEAD; 
	eventParm = ( otherTeam == TEAM_GREEN ) ? GTS_GREENTEAM_TOOK_LEAD;


Seems a bit like ‘lottery’ programming. Rearange code until it works, eh! :unamused: