lfnetwork.com mark read register faq members calendar

Thread: SAGA specifications
Thread Tools Display Modes
Post a new thread. Sorry, this thread is closed. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 09-07-2002, 01:31 PM   #1
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
SAGA specifications

I don't know why, but everyone who works on this seems to think they have the right to keep it secret from the other mappers on the forum. I have figured everything out, so I'm here to help you guys get started pumping out those Saga maps!!!

What's a saga map? The saga gametype is sort of an all-purpose gametype. Meaning that it's essentially for creating your own, simple game times. Saga games are situational games where both teams have a/some objective(s) they're trying to complete, while keeping the other team from completing their objectives. A good example would be a Battle of Hoth scenario where one team (the imperials) is trying to destroy the rebels' shield generator, and the rebels are trying to defend it for 10 minutes. Or some such.

Part I: Playing saga maps

Why is saga a big deal? Because it's already in your Jedi Knight 2 game! It's sitting around in the .qvm files, just waiting to be used! So! The first thing to do is to make it so that Saga shows up in your JK2 game! It's actually quite simple: since saga's already programmed into JK2, all you have to do is make it show up in your menus! So, open up your assets1.pk3 files, go into the ui/jk2mp directory, and export the file gameinfo.txt from the .pk3.

Pop it open, and let's look inside! In two places in the file, you should see:

{ "Free For All" 0 }
{ "Holocron FFA" 1 }
{ "Jedi Master" 2 }
{ "Duel" 3 }
{ "Team FFA" 5 }
{ "Capture the Flag" 7 }
{ "Capture the Ysalimari" 8 }

The first is for the create-a-server menu, the second is for the join-a-server menu. In both of these, add this line among the game types somewhere (doesn't matter in what order you have the gametypes, really):

{ "Saga" 6 }

After adding saga to both lists, save the file, put it back into the .pk3 file (replacing the old copy) and save the .pk3 file. (This should take a minute. Relax!)

Congratulations! Your JK2 game is now set up to play with saga maps!

Part II: Creating saga maps

Saga maps are very much like, say, a capture the flag map in several ways. They have different spawn points according to which team you're on, they allow you to choose your team, they have an objective you must reach, and they require an info_player_intermission or info_player_deathmatch so that the camera has somewhere to be while the player chooses their team/options. There are a few major differences, though, that every mapper should note:

1. Spawn points. For spawn points, the info_player_rebel and info_player_imperial entities are used.

2. Objectives. The info_saga_objective entity is used for achieving objectives. It basically works the same way as your average target_*** entity works. When another entity fires at it, the objective is marked as complete. The info_saga_objective entity has two key/value pairs, "side" and "objective". The "side" value is either 1 (for imperial) or 2 (for rebel). As you can probably guess, this value is for who the objective "belongs" to. That is, whether the objective is an imperial or rebel objective. The second value, "objective" can be any positive integer (whole number), and signifies which objective (for its team) will be marked as completed when the entity is used. Further objective information will be contained in the .saga file, which we will talk about next section.

3. Arena file. To count as a saga map, make sure that "saga" is contained in the game type section of the .arena file.

4. Saga file. A .saga file must be in the map directory of your map's .pk3. I will talk about the .saga specification in the next section.

Part III: .saga Files

As with the .arena file, the .saga file's name must be the same as the map's. However, rather than be in the scripts directory, the .saga file must be in the maps directory. Odd, but there you are. The .saga file consists of two things: groups and paired values.

Groups are large portions of the file, taking up several lines, which are enclosed in curly brackets: {}. Every group has its title in front of the curly brackets. Groups can contain smaller groups, paired values, or both.

A paired value is a value with a name. For instance, the "rebel_message" paired value has the name rebel_message, and a value of, say, "The Imperials destroyed the shield generator!"

Now! There are a number of different groups and paired values that you must know to make an effective .saga file. So! Let's look at an example and pick it apart!

Imperial
{
Objective1
{
message_imperial "The shield generator has been destroyed!"
message_rebel "Our shield generator has been destroyed!"
}
wonround "We have destroyed the shield generator!"
lostround "The rebels have escaped!"
RequiredObjectives 1
attackers 1
}
Rebel
{
Objective1
{
message_rebel "Everyone has managed to evacuate!"
message_imperial "We were unable to destroy the shield generator in time!"
}
wonround "Our forces have evacuated!"
lostround "The Imperials destroyed our shield generator!"
RequiredObjectives 1
attackers 0
}

Notice that there are two main groups: "Imperial" and "Rebel". These two groups have everything important in them. There should be nothing outside these groups. Both groups should have, basically, the same things in them, so let's just look at the imperial group. If you understand one, you understand the other...

Objective1
{
message_imperial "The shield generator has been destroyed!"
}
wonround "We have destroyed the shield generator!"
lostround "The rebels have escaped!"
RequiredObjectives 1
attackers 1

Okay! First thing we have is a subgroup named Objective1. For each objective that must be completed, you should have a subgroup named Objective#. If you do not, the game will completely ignore it when you achieve the objective that you left out.

Notice that there's an objective 1 for BOTH the rebels and imperials. They are NOT the same thing, since there's an individual info_saga_objective for each. Even though both info_saga_objective entities have their objective value as one, one has its side value as 1, and the other has its side value as 2, so that makes them different. The point: you can repeat objectives for different teams, JK2 knows the difference.

Okay! So anyway, let's look at something else that has to do with the Objective1 group:

message_imperial "The shield generator has been destroyed!"

One might assume that this tells the imperials "The shield generator has been destroyed!" when the objective is completed. That person would be bright, but wrong. Here's why:

When an objective is completed, it checks to see if that objective is the last one necessary for a win. If not, it tells the imperials the message_imperial value, and tells the rebels the message_rebel value in the objective's group. However, if it IS the last necessary objective, it totally skips the message_imperial and message_rebel, and instead uses the wonround and lostround values that I'll talk about in a sec. So! It would be perfectly acceptable for me to have written:

Objective1
{
}

instead! So why didn't I? I was trying to make a point... anyhow.

So! Let's look at the rest of those paired values in the Imperial group, shall we?

wonround "We have destroyed the shield generator!"
lostround "The rebels have escaped!"
RequiredObjectives 1
attackers 1

wonround:

If the Imperial team wins, every player on that team is told: "We have destroyed the shield generator!"

lostround:

If the Imperial team loses, every player on that team is told: "The rebels have escaped!"

RequiredObjectives:

If this isn't set, then this team will AUTOMATICALLY WIN when they complete an objective. If you have multiple objectives, this is BAD. Set this to how many objectives the team must complete before they win.

Attackers:

One can assume that bot support in this gametype can be pretty difficult. However, Raven did an... okay job, considering the circumstances... Basically, how bot support in this works is:

For every objective on both sides, it finds the info_saga_objective. Then, it figures out what targets the info_saga_objective. Then, it figures out what targets that. And it just goes on down the line until it figures out the first targeting thing that eventually leads to the info_saga_objecive. Like I said, it does this for every objective on both teams.

Then, if attackers for the team the bot is on is set to 1, it picks out an objective for its team, and attacks in its general direction. If possible, it attacks the entity that first targets the objective... if not possible it at least runs up to it... I'm assuming that if neither one of these things is possible (or if neither one of them completes the objective) the bot will stand around the objective shooting everyone on the other team until it dies.

If attackers is set to 0, however, the bot does pretty much the opposite. It picks out an objective on the OTHER team, makes its way to the objective, and defends it against the opposite team... pretty cool, huh? Not effective all the time, but if you keep your maps relatively simple (until someone sets up better Saga AI) bots should react perfectly!

Well, that covers the entire .saga file specification. So, what're you waiting for! I, for one, am bouncing in my seat wondering what kind of great multiplayer scenarios you guys will pump out! So snap to it!

-Slunker

p.s. Do you guys think this would be a good thing to sticky?


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-07-2002, 01:45 PM   #2
The Truthful Liar
In-Transit
 
The Truthful Liar's Avatar
 
Join Date: Jan 2002
Location: Blasting out of trajectory in a suit of terracotta
Posts: 3,548
LFN Staff Member Forum Veteran 
Awsome

Yeah, I didn't like the secrecy part in aSK's post one bit. Also Tchouky is on the NRG team, I do think that he has a right to fill us in especially.

Nice work Slunker *gives a pat on the back*

(Can I see some of your mapping work?! )


"Whatever action is performed by a great man, common men follow in his footsteps. And whatever standards he sets by exemplary acts, all the world pursues."
The Truthful Liar is offline   you may:
Old 09-07-2002, 01:52 PM   #3
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
You can go to http://taintedg.tripod.com. I have screenies from one of my past projects that I closed since it was a 14-18-map-long SP campaign, and no one wanted to help... no screnies on hoth, yet, since I just finished figuring out about 30 minutes ago... I had a test map that was very small, with a sky shader around it, and two breakables that triggered objective1's for the opposing teams (and therefore one the game for them) Not much to look at at all, but it helped me figure this all out. The other problem with my work is that since I've been doing SP maps up until now, I have NO idea how to set up NPC routing in MP... anyhow! I will set up Battle of Hoth, and it should be pretty neat. I also encourage other people who want to try as well, even if it's on Battle of Hoth. I'd like to see the whole community working on pumping out a few sweet saga maps and servers so that we can start playing it ASAP!

-Slunker


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-07-2002, 02:06 PM   #4
The Truthful Liar
In-Transit
 
The Truthful Liar's Avatar
 
Join Date: Jan 2002
Location: Blasting out of trajectory in a suit of terracotta
Posts: 3,548
LFN Staff Member Forum Veteran 
Oh! It's you! The one who was working on the cave level! *closes eyes* Yes now I remember, I was going to actually ask you if you'd consider joining NRG!

Anyway, I must have had a total brain lapse there, sorry

Nice, I can't wait to see how your upcomming Hoth map looks and plays like


"Whatever action is performed by a great man, common men follow in his footsteps. And whatever standards he sets by exemplary acts, all the world pursues."
The Truthful Liar is offline   you may:
Old 09-07-2002, 02:21 PM   #5
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
*blinks* Because of my work here or because of the cave map? *frowns* I actually have to confess that I'm not that great of a mapper, because I have a horrible lack of attention to detail... I'm trying to become a modder, because I've always been a programmer... but I work with C++ usually, not C... I'm learning, though... managed to figure all this out... now's the hard part: writing NEW code... If I mod, it will likely be for saga mode, though, since it intrigues me... likely a new bot system that involves bot directives in the .saga file... Like, with targetnames, so, like...

Bot
{
Directive1
{
target gun1
priority 0
DESTROY gun1
}
Directive2
{
target gun2
priority 0
DESTROY gun2
}
Directive3
{
priority 1
DESTROY generator
}
}

And, like, priority 0 is only do it when the target is keeping you from your other priorities... or something. Dunno! It'd be pretty cool, though, having more intelligent bots for this... of course, since I can't bot-route, I'm not truly sure just how intelligents bots are in the first place... so. Having the ability for no-lightsaber games would be good for saga too, since sometimes in scenarios you just want weapons...

-Slunker


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-07-2002, 02:22 PM   #6
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
good job.
however there are still some bugs in the saga code. i am sure you will be able to see them right away.

also this is not the full saga specifications. There's more than simple objective completion till RequiredObjective is 1.
since you posted it, I might as well tell them:

there are 2 more fields in Objective# group

final - may have a value of 0 or 1. If the objective has value of final 1 on completion it ends the game immediately with a win for the team. "Do A+B+C or D"

target - has the entity name to activate upon ccompletion. Possible use ranges from simple opening door to activation of some defense mechanism.

[edit]
some more fields that you missed:
roundover_sound_wewon/roundover_sound_welost - sound to play on win/loss
sound_imperial/sound_rebel - same, only for a specific objective

[/edit]

Also, AB_Legend, the reason we kept it in secret was simple: same why Promod source is not being released. It may have bugs/missing features (in fact there are already 2 major bugs in saga code that I had to fix). Not because we want it to be closed.


Last edited by ASk; 09-07-2002 at 03:35 PM.
ASk is offline   you may:
Old 09-07-2002, 02:26 PM   #7
buckman
 
buckman's Avatar
 
Join Date: Jul 2002
Location: sweden
Posts: 185
wow, great!

Now, i know that i will be alot of work making a saga-map so why dont we make one toghether, cooperating with eachother !? I have tried the saga maptype on a very simple map, and i succeded! But i dont really have the time it will take to make a GOOD saga-map, because im in school.

If anyone is intereted in working with me on this one, please respond!

-Buck out


AotC-TC, Mapper

Avatar made by: myself
buckman is offline   you may:
Old 09-07-2002, 02:29 PM   #8
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
oh and not really related, but there's also g_gametype 4.

the name is GT_SINGLE_PLAYER. Before you drool with happiness, I must shatter your hopes: it does nothing. Or more precisely almost nothing. It makes bots a little bit more aggressive.


[edit]

<rant>
and of course Slunker gets the glory and me and Tchouky are forgotten.
</rant>

seriously, let me direct you here:
http://www.lucasforums.com/showthrea...threadid=62141

This was my original thread on SAGA, which died because I missed the Objective# part in the code.

ASk is offline   you may:
Old 09-07-2002, 02:55 PM   #9
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
also
since Tchouky is urging me to be nice

here are the bug fixes:

1) objective can be triggered by any team member:

g_saga.c, sagaTriggerUseFunction

below
Code:
if (activator && activator->client)
	{ //activator will hopefully be the person who triggered this event
		clUser = activator->s.number;
	}
add
Code:
if(ent->side != activator->client->sess.sessionTeam) // only allow Imperial to trigger imperial objs and vice-versa
	{
		return;
	}
[edit]
note: Tchouky told me that this behaviour is undesirable sometimes. That's what I did:

i add a field to .saga specifications called "bothteams". if it's 1, both teams can trigger the objective (of course it will count for the originally intended team - something like "be careful or it blows up in your face".

here are the changes:

in sagatriggeruse:
Code:
int				bothteams=0;
in the if (GetValueGroup(objectives, objectivestr, desiredobjective)) if add at the top:

Code:
if (GetPairedValue(desiredobjective, "bothteams", teamstr))
			{
				
				bothteams = atoi(teamstr);
				
			}
			
			if(!bothteams)	
			{
				if(ent->side != activator->client->sess.sessionTeam) // only allow Imperial to trigger imperial objs and vice-versa
				{
					return;
				}
			}
and remove the original if(ent->side!=.... block.
it could do something like: we have a highly explosive substance. Defend it from imperial, but be careful so it does not explode
[/edit]
2) objective can be triggered multiple times:

here i decided to use an array where the elements are 1 or 0 depending if the objective was completed. This effectively limits the max objective number for each team, but 50 should be more than enough:
at the start of the file add this:
Code:
#define MAX_OBJ_NUM 50
int			rebel_obj[MAX_OBJ_NUM];
int			imperial_obj[MAX_OBJ_NUM];
in InitSagaMode()
Code:
// Just to be safe, reset both arrays to 0
	for(i=0; i<MAX_OBJ_NUM; i++)
	{
		imperial_obj[i]=0;
		rebel_obj[i]=0;
	}
better be safe than sorry

in sagaTriggerUse:

Code:
// =============       Disable multiple triggering of one entity over and over ========//
	if(ent->side == SAGATEAM_IMPERIAL)
	{
		if(imperial_obj[ent->objective]==1)  // already triggered 
		{
			return;
		}
		imperial_obj[ent->objective]=1;
	}
	else
	{
		if(rebel_obj[ent->objective]==1)  // already triggered 
		{
			return;
		}
		rebel_obj[ent->objective]=1;
	}
these fixes are simple but important.

the bug that remains is team score not updating. It is a fairly simple edit to do, but I didn't have the patience.


Last edited by ASk; 09-07-2002 at 03:42 PM.
ASk is offline   you may:
Old 09-07-2002, 04:12 PM   #10
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
I'll add my two cents on this. ASk, Tchouky, the test mappers and I were only keeping it a secret until we got the full specs figured out and tested. ASk posted about this game mode months ago, but noone ever came forward with a solution.

Slunker does have functional specs but he didn't post the FULL specs. We fully intended to release the information once we had figured it out. In fact, we were just about ready when this was posted. There was no malice involved.

It should also be noted that the .saga file scanner code is real bitchy. Here's my notes on the subject:

Definition Group:

You MUST have a definition group in the following formats or it wouldn’t work correctly:

//Definition group name, followed by ONE space and a ‘{‘.
TargetName {
}

//Definition group name follow immediately by a carriage return (AKA ‘\n’).
//The function will scan thru everything after that point until it finds a ‘{‘.
TargetName
{
}

Basically, it’s rather easy to confuse the code, so try to pick a name for your definition group that isn’t used prior to the definition group. I also notice that there isn’t any comment deletion system in group scan code, so be careful with your comments as they could be mistaken for the beginning of a definition group. In addition, be sure you have an equal amount of open and close brackets (‘{‘ and ‘}’) or the scan will prematurely terminate.

Varibles:

The variable value must be followed immediately by a carriage return, but spaces and such seem to be allowed.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Old 09-07-2002, 04:35 PM   #11
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
A:

THis works:

blah
{
}

Because it searches through to find the first {.

B:

// works to comment code out, because if a line starts with two slashes, the entire line is converted to slashes.

-Slunker


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-07-2002, 04:57 PM   #12
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
Quote:
THis works:

blah
{
}

Because it searches through to find the first {.
Only if you do a carriage return immediately AFTEr the definition group name, in this case "blah". If you have a carriage return in that way. The code will scan until it finds a "{".
Quote:
// works to comment code out, because if a line starts with two slashes, the entire line is converted to slashes.
Only by the GetPairedValue function (which is run after the definition group is scanned in). It's possible to trick the program by making a comment look like a definition group start. It's best designed scanner in the world, but Raven admits that in the code comments.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Old 09-07-2002, 05:01 PM   #13
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
Adding team points to the winning team at the end of the game:

in the game source (not the cgame), the file g_saga.c:

void AddSagaWinningTeamPoints(int team, int winner)
{
int i = 0;
gentity_t *ent;
while (i < MAX_CLIENTS)
{
ent = &g_entities[i];
if (ent && ent->client && ent->client->sess.sessionTeam == team)
{
if (i == winner)
{
AddScore(ent, ent->client->ps.origin, SAGA_POINTS_TEAMWONROUND+SAGA_POINTS_FINALOBJECTIV ECOMPLETED);
}
else
{
AddScore(ent, ent->client->ps.origin, SAGA_POINTS_TEAMWONROUND);
}
}
i++;
}
}

After:

if (i == winner)
{
AddScore(ent, ent->client->ps.origin, SAGA_POINTS_TEAMWONROUND+SAGA_POINTS_FINALOBJECTIV ECOMPLETED);

put:
AddTeamScore(ent->s.pos.trBase,team,1);

This only changes the score when one team wins... *shrugs* It would be a minor matter to change that to each completed objective, but that might show an unrealistic portrayal of the game, depending on the scenario, so I decided against it.

-Slunker


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-07-2002, 05:05 PM   #14
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
Here's an idea I just had:

So many options that have to do with a scenario are scenario specific. Things like lightsaber-only, no-force-powers, what skins each player can use, etc. change from scenario to scenario, and, to preserve the gameplay quality, would have to be remembered and changed by admin every time they use a map, under normal circumstances. So! What if these options were stuck as paired values under a "World" group in the .saga file? I'd be more than willing to help if you don't want to go to the trouble to do this. It doesn't sound too difficult.

-SLunker


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-07-2002, 05:06 PM   #15
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
I submit now the mini-mod that fixes the bugs in SAGA.
Slunker: you are credited only for these things - changing of ui and changing of .arena. The .saga credits go to Razor Ace and Tchouky and myself.

ASk is offline   you may:
Old 09-07-2002, 05:14 PM   #16
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
Again, good job on that. We totally missed the UI saga stuff.

As for specific scenario sets, that would require a medium amount of code modifications as we'd have to add scenario overrides to all the model selection and such. I'm starting to design Saga improvements for MotF and will look into/think about it.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Old 09-07-2002, 05:15 PM   #17
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
oh and the saga parser IS very picky

some groups it won't find, no matter what.
it repeatedly could not find bothteams group, no matter what I done.


If it will pick the new pairs, it wont be too hard to do


the mod is available at
http://www.darklordsofsith.com/ask/saga_mod.zip
for download
ASk is offline   you may:
Old 09-07-2002, 05:58 PM   #18
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
According to the code comments, it's just the botfile parser cut and pasted.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Old 09-08-2002, 01:19 AM   #19
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
I know. That still does not explain why a simple resaving of file suddenly gets it to see the group it had not seen before.

ASk is offline   you may:
Old 09-08-2002, 02:25 AM   #20
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
maybe the resave changed the carriage return locations....


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Old 09-08-2002, 02:31 AM   #21
Metallus
Episodic!
 
Metallus's Avatar
 
Join Date: Aug 2001
Location: California, USA
Posts: 3,370
Old News! LFN Staff Member Notable contributor Forum Veteran 
Topic is now stuckified by extra-special request.


Guy.
Metallus is offline   you may:
Old 09-08-2002, 03:16 AM   #22
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
We feel blessed.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Old 09-08-2002, 01:44 PM   #23
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
PROBLEM FIXED.

The problem is tabs. In the "game" project, all objectives, when parsed, use the "strip_tabs" function to remove all the tabs in the group. So! This means that if you separate your paired values using tabs, the separation is removed. How to fix this problem? I set up strip_tabs (to be found in g_saga.c) function to remove all but one consecutive tabs. (So, if you have 3 tabs in a row, it turns to 1, if you have 1 tab in a row, nothing happens...)

Like so.. Change this line:

if (buf[i] != 9)

to this:

if(buf[i] != 9 || buf[i+1] != 9)

This fixes the problem! Everything should work now! (Yayyyy)

-Slunker


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-08-2002, 01:58 PM   #24
Tchouky
 
Tchouky's Avatar
 
Join Date: Apr 2002
Location: Eclipse (jeedai secret base)
Posts: 543
well i worked on this problem too this afternoon and there is a more simple way :

DON'T USE TABS
use spaces

on space is enought!

example of a saga file with 3 objectives :
Code:
//saga info file
Rebel
{
	RequiredObjectives		2
	attackers			1
	wonround			"rebels objectives done"
	lostround			"imperials objectives done"
	Objective2
	{
		final 			0
		target 			obj1_name
		message_rebel "Congratulations! Objective 1 complete!"
		message_imperial "You suck! Objective 1 was completed"
	}
	Objective3
	{
		final 			0
		target 			obj2_name
		message_rebel "Congratulations! Objective 2 complete!"
		message_imperial "You suck! Objective 2 was completed"
	}
	Objective4
	{
		final 1
		target obj3_name
		message_rebel "Congratulations! FINAL Objective complete!"
		message_imperial "You suck! FINAL Objective was completed"
	}
}
//imperial here
Imperial
{
	RequiredObjectives 1
	attackers 0
	wonround "Congratulations imperials win"
	lostround "You Suck imperials loose"
	Objective1
	{
		final 1
		target obj2_name
		message_imperial "Congratulations! Objective 1 complete!"
		message_rebel "You suck! Objective 1 was completed"
	}
}
enjoy

Tchouky is offline   you may:
Old 09-08-2002, 02:03 PM   #25
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
*shrugs* Yah, a single space among the tabs corrects the problem just fine, but considering that plenty of people will be using saga specs, I see no reason not to just fix the problem and let people do what they want...

-Slunker


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-08-2002, 02:14 PM   #26
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
Good job.

I was stuck on this for quite some time already, thinking why it displayed the round won/loss messages correctly but not objective won/loss messages NOR the custom sounds.

Ah and another note: the default sound in the code is an un-existant one. That's why there's no sound on objective/round completion.


Only thing I hope, is that people will actually play and like this gametype.

ASk is offline   you may:
Old 09-08-2002, 08:46 PM   #27
DeTRiTiC-iQ
 
DeTRiTiC-iQ's Avatar
 
Join Date: Mar 2002
Location: England
Posts: 540
Since this gametype evidently will become a mod due to the quantity of modfieid coding, I just you all work together. SAGA will not succeed if their are dozens of different versions that people have to download just to play individual maps.

Secondly, this needs to become a full mod, not just something which unlocks the gametype and adds a few tweaks to the code, a class system would be nice to see.

Thirdly, when the mod is running, hide the other gametypes in the same way that Hydroball only lets you select the one gametype.

Finally, I have been waiting for this kind of project ever since I expressed my view that Infiltrate! for JK should be revived, since this is close, I am keen to make maps for it.
DeTRiTiC-iQ is offline   you may:
Old 09-08-2002, 09:00 PM   #28
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
Hmmmmm....

I managed to set up my source to use a "World" group, and made a paired value that sets/unsets lightsaber-only. Force disabled is apparently a bit trickier. I can set the g_forcePowerDisable cvar, but it isn't doing anything, really. Afterwards, I run WPInitForcePowers() or whatever the func is, but that doesn't accomplish anything, either. I think that perhaps WPInitForcePowers() needs to be reprogrammed, because it has special areas for CTF/CTY and GT_TOURNAMENT... probably others, I got tired of digging through source code and took a break for the day afterward. Anyhow. Progress is being made. After getting diabling force powers to work, I'm going to make a big project out of nolightsaber mode (and it accompanying control from the .saga file). Lastly, limiting available skins by team (i.e. Stormtrooper and Imperial are the only available skins for the Imperial team, Rebel is the only available skin for the rebel team, or some such) would be a fun option to have available (but not absolutely necessary), to make the scenarios seem more... *shrugs* realistic?

-Slunker

btw, if anyone has a better understanding of disabling force powers, and knows of something necessary other than changing the cvar and running that function, please say so.


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-08-2002, 11:00 PM   #29
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
For force powers and stuff, wouldn't the easiest way be to add a function to the initsagamode that reads the "world" definition group and set the cvars on startup. As for the model and skins sounds like it would take a lot of rewriting in the UI and cg files. Say, how are you planning on releasing this code? A lot of people are complaining that there's too many server varities / Mods as is. It would probably be a good idea if we all get together and make a single upgraded Saga Mod instead of 50 zillion different minor Mods....

Razor Ace


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Old 09-09-2002, 03:36 AM   #30
Mr Tim
 
Mr Tim's Avatar
 
Join Date: Mar 2002
Location: Australia
Posts: 76
Without having much experience in this kind of thing, except as an end-user (read - gamer) and someone with a slightly vague plan to get involved in this side of things in future...

Instead of releasing this as a mod in its own right (as seems to have been cavassed above), wouldn't it be better to simply make the code available to any mod makers who want to create objective based mods and/or maps in the future? Basically, open source code to be implemented wherever and by whoever needs it.

I don't see much use in having this as a mod in its own right (which seems to be what others were saying). Incorporate it into a mod or foget about it, would be my humble view for any actual or potential mod makers out there.
Mr Tim is offline   you may:
Old 09-09-2002, 07:25 AM   #31
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
I am ready to help in any way I can

ASk is offline   you may:
Old 09-09-2002, 08:34 AM   #32
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
That's how I'm using the cvars... at the end of the saga_init function, it reads in World, and all the accompanying paired values (only 2 right now, one that works)...

Yah, that skins thing'll be... difficult. But! That's a long way away as I see it, so! I guess I'll have to look harder at WP_ForcePowerInit() if no one has any ideas.

As far as open source goes: I agree that releasing our improvements here as source code will be important, since: any mod we release will incorporate a working version of an entire gametype. It makes sense for it to be public property, therefore, since the working source for all other gametypes (except, uh... duel_tournament and single_player- the other two unreleased gametypes) is public property. HOWEVER. Releasing this as a mod in its own right is important, because otherwise, saga gametype will never be used. Get it? So. Anyhow! If you'd like the source for the noweaps code, it's pretty easy. At the end of Saga_init() (outside all enclosing if statements related with the rebel/imperial groups...)

if (GetValueGroup(saga_info,"World",objectives))
{
if(GetPairedValue(objectives,"noweaps",goalreq))
{
trap_Cvar_Set("g_weaponDisable",goalreq);
}
}

Pretty easy, like I said. Notice that I send goalreq to trav_Cvar_Set, not atoi(goalreq). Obviously, this is because the value argument of trap_Cvar_Set() is a character pointer. Okay!

-Slunker


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-09-2002, 08:52 AM   #33
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
Quote:
since the working source for all other gametypes (except, uh... duel_tournament and single_player- the other two unreleased gametypes) is public property
GT_TOURNAMENT is the Duel gametype
GT_SINGLE_PLAYER does nothing except a bit more aggressive bots. It's most likely a remaining gametype from Quake 3 Single Player game.

ASk is offline   you may:
Old 09-09-2002, 01:56 PM   #34
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
Quote:
Originally posted by Slunker

if (GetValueGroup(saga_info,"World",objectives))
{
if(GetPairedValue(objectives,"noweaps",goalreq))
{
trap_Cvar_Set("g_weaponDisable",goalreq);
}
}

-Slunker
It would be easier on the parser code if you added the Strip_Tabs() before the GetPairedValue.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Old 09-09-2002, 03:40 PM   #35
DeTRiTiC-iQ
 
DeTRiTiC-iQ's Avatar
 
Join Date: Mar 2002
Location: England
Posts: 540
The way I see it, release it with all the current code fixes so that mappers can get started, and so that they can be played.

But continue working with it and make it into a proper team-game with classes etc. We've had too many minor mods, ie saber tweaks, jetpack etc. Games thrive on actual gametype modifications not minor mods.

As I said in an earlier post, this is exactly the type of project i've been waiting for, but since i'm a mapper not a coder (yet) I haven't gone anywhere far. If done well this could become very popular.

If you want maps/websites/ideas/rants contact me - det@massassi.net
DeTRiTiC-iQ is offline   you may:
Old 09-09-2002, 04:09 PM   #36
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
At least half a dozen teams are working on that sort of project. They can do whatever they want with class-types and crap. This is just for improving the Saga code for a more varible gamemode.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Old 09-09-2002, 08:45 PM   #37
Miggs the Just
 
Miggs the Just's Avatar
 
Join Date: Aug 2002
Posts: 40
cant you guys just use the g_jediVmerc for force disabling. Obviously it wouldnt work for some senario's but for a Rebel Vs. Empire map it would well.

This sucks cause i just finished my map today. I was able to make a objective based map just with CTF with no coding. But it looks like Ill have to change it to Saga now. If you guys need help with this Ill help with anything, this is definitely what this game needs, And we do need to work together and get a fleshed out mod, try to enclude Jedimod, jetpack, grapple...ect. we can make it like a patch 1.05 to bring this game back to life.

anyways I think JediVmerc is the way to go, one Idea I had was to make Mercs start with Detpacks and use them like engineers in RTCW, that way jedi would be better fighters but Mercs would be vital to winning objectives.

I'll put the map up later anyways.

Last edited by Miggs the Just; 09-09-2002 at 08:56 PM.
Miggs the Just is offline   you may:
Old 09-10-2002, 08:29 AM   #38
Slunker
 
Slunker's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 124
Good idea on the striptabs() thing, btw. And with JediVMerc, I'm simply not going to use that, since that is not my original intention. My original intention was to make it so that force powers could be totally disabled from the .saga file. It WILL be done that way. Classes and such, (but more specifically, the ability for the mapmaker to create his own classes for his own map) are important, but not our current objective. As far as I see, there should be nothing out of control of the mapper, so using g_JediVMerc and making it so that jedis fight and mercs complete objective isn't what we're after at all. That would be creating a gamme. We're creating a gametype. The differences are huge.

-Slunker


"The chief difference between men and women is that men forget, but never forgive, while women forgive, but never forget."
-Thom Merrilin, The Wheel of Time series
Slunker is offline   you may:
Old 09-12-2002, 02:51 AM   #39
monsoontide
Multiple Arm Attack!
 
monsoontide's Avatar
 
Join Date: May 2002
Location: New Zealand
Posts: 1,092
Post

NOW THIS IS A GAMEPLAY MODE!

Excellent work guys. I've been wanting to do something like this in JK2 ever since playing some of those cool MP levels in Return To Castle Wolenstein.
Esp. the blow up the Submarine level ;-)

My current map is nearly complete and I am eager to add this gameplay mode to the map.

I think I follow the instructions, but perhaps a tutorial (with PIX) would be beneficial.

I will propbably be posting a few questions as I go though as my coding skills are kinda rusty/extinct.

Monsoontide
monsoontide is offline   you may:
Old 09-12-2002, 05:50 AM   #40
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
monsoontide is correct, we need a tutorial AND a coordinated Saga 2.0 project. I can help coordinate Saga 2.0, but I'm not up for writing a Saga 1.0 tutorial. I don't understand the mapping aspect of the system AND I got a full plate of writing with MotF.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may:
Post a new thread. Sorry, this thread is closed. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JO Mapping > SAGA specifications

Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:36 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.