Posted by: DarkNight
Date posted: Apr 15 2003 User Rating: 5 out of 5.0 | Number of views: 1832 Number of comments: 1 | Description: Setting up Client side and FGD |
This part of the tutorial will show you how to setup the client side and the FGD for the CTF Gamerules.
NOTE: This code will need modifying to suit your team system,ect so don't take this as a complete C&P (which it basically is).
Open up hl_events.cpp and find the following: void EV_TripmineFire( struct event_args_s *args ); and put this after it:
| | void EV_Flag( struct event_args_s *args );
|
Next, in the same file, find: gEngfuncs.pfnHookEvent( "events/tripfire.sc", EV_TripmineFire ); and after it put this:
| | gEngfuncs.pfnHookEvent( "events/object.sc", EV_Flag );
|
Next, in ev_hldm.cpp, find: void EV_TripmineFire( struct event_args_s *args ); and at the end of that function put this:
| | void EV_Flag(struct event_args_s *args );
|
Same file, ev_hldm.cpp, find: void EV_TripmineFire( event_args_t *args ) and at the end of that function put this:
| | #define FLAG_STOLEN 1 #define FLAG_CAPTURE 2 #define FLAG_DROPPED 3
void EV_Flag( event_args_t *args ) { int idx = args->entindex; int type = args->iparam1;
// Feel free to change the model that is attached to the player int FlagModel = gEngfuncs.pEventAPI->EV_FindModelIndex("models/flag.mdl");
switch( type ) { case FLAG_STOLEN: // Attach model to player gEngfuncs.pEfxAPI->R_AttachTentToPlayer( idx, FlagModel, 52, 9999); // The 52 is the z offset from the player and the 9999 is how long you want it to be attached for // Add more stuff here if you like break; case FLAG_CAPTURE: // Add stuff here if you like case FLAG_DROPPED: // Add more stuff here if you like // This gets rid of the attached model gEngfuncs.pEfxAPI->R_KillAttachedTents(idx); break; } }
|
Now to setup the FGD we do the following at the bottom of the FGD:
| | @PointClass = object_flag: "The Flag" [] @SolidClass base(Targetx) = capture_team1: "Where Team 1 brings the Flag" [ m_iPoints(integer) : "Points" : 1 ] @SolidClass base(Targetx) = capture_team2: "Where Team 2 brings the Flag" [ m_iPoints(integer) : "Points" : 1 ]
|
And that concludes my 3 Part tutorial on the CTF Gameplay. If you have any complaints, suggestions,problems,ect. Feel free to email me at the_dark_wonderer@hotmail.com |
|
User Comments
Showing comments 1-1
Where I can find ctf_objects.h? |
|
You must register to post a comment. If you have already registered, you must login.
|
Any money that is donated will go towards the server costs that I incur for running our server. Don't feel you HAVE to donate, but the link is there if you want to help us out a little. Thanks :)
|
296 Approved Articless
3 Pending Articles
3940 Registered Members
0 People Online (18 guests)
|
|