Checkpoint [q3geoball]

Locked
Landix
Posts: 123
Joined: Wed Feb 28, 2007 5:57 pm

Checkpoint [q3geoball]

Post by Landix »

I there.... again :icon31:

Is there a way to add checkpoints to quake 3 Arena?

I thinking about of get all items armors or what else in the map are usefully for this, to make the teleporter free for the next level, or open a door....!?

So MAN or WOMAN must collect all these items before he/she can "Roll" to the next map.

Somebody can helping me out with this?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

You'll want to use triggers for this so take a look at game/g_trigger.c. In (Q3|Gtk)Radiant, create a stock trigger and change its classname in the entity window to whatever you named yours. Let me know if you run into any specific problems.
Landix
Posts: 123
Joined: Wed Feb 28, 2007 5:57 pm

Post by Landix »

I have this yet:

in the ent..def for gtk i add the lines:

Code: Select all

/*QUAKED trigger_collect (.5 .5 .5)
collect 3 Armors to finish map 
-------- KEYS --------
*/
in the g_trigger.c i add this yet:

Code: Select all

/*QUAKED trigger_collect (.5 .5 .5)
collect 3 Armors to finish map 
*/
void SP_trigger_once( gentity_t *ent) {

}
So what writing then?
When the 3 Armors are collected a door should be open or something like this!?

thx for help
Landix
Posts: 123
Joined: Wed Feb 28, 2007 5:57 pm

Post by Landix »

Hmmm....

can i use this?

Code: Select all

The target_objective entity is what makes objective driven events 

If you walk into a trigger_multiple with these keys:
checkObjective = SomeObjective
objectiveMinState = 2
objectiveMaxState = 4
and the SomeObjective target_objective entity has a state of 5.
The trigger_multiple would NOT trigger its target.
But if the state was 2, 3 or 4 it would trigger its target.
This is in EF i think
Landix
Posts: 123
Joined: Wed Feb 28, 2007 5:57 pm

Post by Landix »

I mean this!:

Code: Select all

void target_objective_use( gentity_t *self, gentity_t *other, gentity_t *activator )
{
	gentity_t *tent;

	tent = G_TempEntity( self->r.currentOrigin, EV_OBJECTIVE_COMPLETE );
	//Be sure to send the event to everyone
	tent->r.svFlags |= SVF_BROADCAST;
	tent->s.eventParm = self->count;
}

void SP_target_objective (gentity_t *self)
{
	if ( self->count <= 0 )
	{
		//FIXME: error msg
		G_FreeEntity( self );
		return;
	}
	if ( self->targetname )
	{
		self->use = target_objective_use;
	}
	level.numObjectives++;
}
:p

I am right?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

Yep. That'd do the trick.
Landix
Posts: 123
Joined: Wed Feb 28, 2007 5:57 pm

Post by Landix »

I will try this out

thx
Locked