AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CSS] Rally Race Mod (https://forums.alliedmods.net/showthread.php?t=110160)

raydan 11-25-2009 20:58

[CSS] Rally Race Mod
 
7 Attachment(s)
[IMG]http://img9.**************/img9/4986/cssbuggy.png[/IMG]
Counter Strike:Source Rally Race Mod

This is a CSS mod. Drive HL2 vehicle in CSS to play rally race. Support vehicle engine sound, car engine boost, 16 racer in a map, checkpoints, place.
You can use the extension to make you own Race Mod
That is possible to create a drivable vehicle in TF2, DODS, L4D1/2(use vehicle kill zombie)


Current Version
extension 1.0.0.1
plugin 1.0.0.5

Code:

rallyrace_readytime - 20 - Ready Time
rallyrace_racetime - 320 - Racers will force suicide to end current race round after this value (0 = disable)
rallyrace_raceround - 6 - After how many race round start a map vote? (0 = disable)



:arrow:Newbie Install:
1. Download newbie_pack_plugin.zip, unzip to "cstrike" folder
2. Download "rallyrace.sp" & Compile the "rallyrace.sp"


:arrow:Manual Install:
1. Download css_patch.zip, unzip to "cstrike" folder
2. Go to "cstrike\scripts" folder, open "game_sounds_manifest.txt" file.
Add the following code
Code:

"preload_file"  "scripts/game_sounds_vehicles.txt"
then the file will become like this
Code:

game_sounds_manifest
{
  "precache_file"  "scripts/game_sounds_hostages.txt"
  "precache_file"  "scripts/game_sounds_bots.txt"
 
  "preload_file"  "scripts/game_sounds.txt"
  "preload_file"  "scripts/game_sounds_physics.txt"
  "preload_file"  "scripts/game_sounds_radio.txt"
  "preload_file"  "scripts/game_sounds_weapons.txt"
  "preload_file"  "scripts/game_sounds_ambient_generic.txt"
  "preload_file"  "scripts/game_sounds_world.txt"
  // Level sounds
  "preload_file"  "scripts/level_sounds_general.txt"
  "preload_file"  "scripts/game_sounds_vehicles.txt"
}

3. Download rallyrace_materials.zip, unzip to "cstrike" folder. If you are using sv_downloadurl, upload to your download server too
4. Download rallyrace_plugin.zip, unzip to "cstrike\addons\sourcemod".
5. Download "rallyrace.sp" & Compile the "rallyrace.sp"


:arrow:Race map:
race_derby_v1.zip is a map file
another 2 map files, http://www.sendspace.com/file/er7v8f
You can create race map for this plugin
There are 4 types special entity for this plugin, all are defined in rallyrace.sp:

Check Point: car check points
Classname: "trigger_multiple"
Targetname: "checkpoint_#"+(1..)
Wait (Delay before reset): 0.1 (best value is 0.1, don't set 0)
for the first checkpoint, targetname must be "checkpoint_#1", second checkpoint, "checkpoint_#2". (up to checkpoint_#x , where x is the largest integer number in sourcemod, and don't make stupid things, like checkpoint_#-1, checkpoint_#a, checkpoint_## and so on, if server crash don't ask me)

Ready Zone: when player inside the zone, mean player can play on next race round
Classname: "trigger_multiple"
Targetname: "ready_zone"
Wait: 0.1 or default
Create a "env_sprite", use model "zx2_car/go.vmt", put it into the "ready_zone" center, it will show a "GO!" picture

Spectate Zone: when player inside the zone, switch player to spectate team directly
Classname: "trigger_multiple"
Targetname: "spectate_zone"
Wait: 0.1 or default
Create a "cycler", use model "models/gman.mdl", let player know there is a spectate zone (or some sexy model)

Car Spawn Point: car spawn points
Classname: "info_target"
Targetname: "car_spawn"
Angle: you must set the correct angle


:arrow:How to control my car:
W = Forward
S = Backward
A = Left
D = Right
Space bar = Handbrake
Shift = Boost


:arrow:Requirement:
metamod source 1.7.1 +
sourcemod 1.2 +
sourcemod mapchooser.smx


:arrow:For plugin coding:
server will crash if you remove a car that contain driver inside. You should kill or remove the driver first.
hope you can read my code, because there are no comment (may be add back later)
use "rallyrace.inc" to create plugin for this mod


:arrow:How to Add Car:
support up to 100 cars, if you need more, open the "rallyrace.sp", change MAX_CAR value
example to add tacoma car http://forums.alliedmods.net/showpos...3&postcount=57
open configs/rallyrace/carconfig.txt
Code:

"RallyRaceCar"
{
 "1"
 {
  "model"  "models/buggy.mdl"
  "script" "scripts/vehicles/ep1.txt"
  "skin_min" "0"
  "skin_max" "0"
 }
"2"
 {
  "model"  "models/natalya/tacoma/tacoma.mdl"
  "script" "scripts/vehicles/tacoma.txt"
  "skin_min" "0"
  "skin_max" "7" // tacoma have 8 skins? i don't know (0...7)
 }
}

then open configs/rallyrace/download.txt, add any files you want add to download, if file end with ".mdl" will auto precache!


:arrow:Version:
1.0.0.1
Fix late join player
Add some Cvars for config
Add some code comment in .sp & .inc
Add map vote
Changed 2 forward prototype
When race finish, all map entities will reset

1.0.0.2
Add remove idle weapon
Remove team change message

1.0.0.3
Fix player team error

1.0.0.4
zip file not contain .sp file anymore
Fix again, should work now

1.0.0.5
Add a forward OnPlayerFinishRace
Add file configs/rallyrace/carconfig.txt
Add file configs/rallyrace/download.txt


.

tigerox 11-25-2009 21:09

Re: [CSS] Rally Race Mod
 
Runs really nice.

Great work. This has lots of modding potential: new models, maps, etc. One thing I needed to change was to restart the round once the race is over. This resets the map so glass, barrells, etc gets reset.

RallyRace::MOD 69.162.97.22:27015

FrozenHaxor 11-25-2009 21:11

Re: [CSS] Rally Race Mod
 
Can you please write a small plugin to spawn car by Admin command (for example in position where Admin is looking). I mean car that only Admin is allowed to drive by using E on car like in HL2, or if its too hard to do, just drivable by everyone, it can also be something like "Admin is typing command, and car is spawning in his angle and he is instantly driving it" - I think it would be the simplest way :shock:

I tried to do it myself, but my coding experience is not enough :|


Also, it would be nice to parent a prop_dynamic with animated crouching player on the chair instead of nothing inside car :roll:


Well, if its possible to do for you, you will get lots of +karma from me! :mrgreen:

raydan 11-26-2009 03:50

Re: [CSS] Rally Race Mod
 
Quote:

Originally Posted by tigerox (Post 999268)
Runs really nice.

Great work. This has lots of modding potential: new models, maps, etc. One thing I needed to change was to restart the round once the race is over. This resets the map so glass, barrells, etc gets reset.

RallyRace::MOD 69.162.97.22:27015

restart the round will make players respawn
the reason why don't do that is
"car spawn order is order by time of join ready zone"

may be there are a signature to let all prop reset

raydan 11-26-2009 04:01

Re: [CSS] Rally Race Mod
 
Quote:

Originally Posted by FrozenHaxor (Post 999271)
Can you please write a small plugin to spawn car by Admin command (for example in position where Admin is looking). I mean car that only Admin is allowed to drive by using E on car like in HL2, or if its too hard to do, just drivable by everyone, it can also be something like "Admin is typing command, and car is spawning in his angle and he is instantly driving it" - I think it would be the simplest way :shock:

I tried to do it myself, but my coding experience is not enough :|


Also, it would be nice to parent a prop_dynamic with animated crouching player on the chair instead of nothing inside car :roll:


Well, if its possible to do for you, you will get lots of +karma from me! :mrgreen:

i haven't create a forward like that "CanEnterVehicle", may be add into extension later

if you look the .sp file, you can know how to spawn a working jeep
if spawn a default jeep, driver is invisible(observer/death player can't view the driver, same as HL2DM - airboat). if you make player visible, you can see the player is "stand on the jeep and using a knife", so wired. Who can fix that?

tigerox 11-26-2009 08:37

Re: [CSS] Rally Race Mod
 
I see what you are saying about the spawn order.

It would be nice to reset the map objects. There must be another way.

- A few notes -
Bug:
-The sound cuts out for a few seconds from time to time. A few players mentioned this.
Comments:
- It would be nice to keep the best lap time for each map. Gives you something to achive; player holding the best time on the map.
- When a players joins during the race it should let them know they need to wait till the race is done.
- Need a way to change the map, after x number of races or something.

Thanks again for a great mod.

blodia 11-26-2009 18:40

Re: [CSS] Rally Race Mod
 
... i was working on a vehicle mod aswell but through scripting only, almost had it finished. good work never the less.

FrozenHaxor 11-27-2009 00:09

Re: [CSS] Rally Race Mod
 
Quote:

Originally Posted by raydan (Post 999404)
i haven't create a forward like that "CanEnterVehicle", may be add into extension later

if you look the .sp file, you can know how to spawn a working jeep
if spawn a default jeep, driver is invisible(observer/death player can't view the driver, same as HL2DM - airboat). if you make player visible, you can see the player is "stand on the jeep and using a knife", so wired. Who can fix that?

Well,
PHP Code:

public CreateJeep()
{
    new 
ent  CreateEntityByName("prop_vehicle_driveable");
    if(
IsValidEntity(ent))
    {
        
DispatchKeyValue(ent"vehiclescript""scripts/vehicles/ep1.txt");
        
DispatchKeyValue(ent"model""models/buggy.mdl");
        
DispatchKeyValue(ent"solid","6");
        
DispatchKeyValue(ent"actionScale","1");
        
DispatchKeyValue(ent"EnableGun","0");
        
DispatchKeyValue(ent"ignorenormals","0");
        
DispatchKeyValue(ent"fadescale","1");
        
DispatchKeyValue(ent"fademindist","-1");
        
DispatchKeyValue(ent"VehicleLocked","0");
        
DispatchKeyValue(ent"screenspacefade","0");
        
DispatchKeyValue(ent"spawnflags""256" );
        
DispatchSpawn(ent);
        
RCM_InitJeep(ent);
    }
    return 
ent;


This code will create a "usable" and working Jeep? Means I have to use natives from your's inc and extension all the ways to get a working Jeep? Or extension is just for other part of Rally Race? :P

raydan 11-27-2009 01:13

Re: [CSS] Rally Race Mod
 
use CreateJeep() then teleport it, you will get a working jeep

mats 11-27-2009 08:55

Re: [CSS] Rally Race Mod
 
I have some problems, late joiner don't spam in the wait area also after the race has ended. they just stay dead. and it should force round end so the things in the map reload and the map change change after vote.

And it would be nice if there is a high score saving and some help cause people don't know what to do :)

And see people in the cars, and if the first one finish the should be only like 30seconds for the other racers and then the round should restart. :)

my server ip: 82.197.223.125:27015


All times are GMT -4. The time now is 14:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.