Author Topic: [Request] Flame Race Mode  (Read 3903 times)

0 Members and 1 Guest are viewing this topic.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
[Request] Flame Race Mode
« on: September 06, 2010, 09:08:54 pm »
i tried coding this but failed miserably

how it is at the moment for those interested, only thing that doesnt work is checkpoints

http://pastebin.com/GgTyWmLZ

from my messin around i do believe its 100% possible

im not exactly pro at coding either, but, it seems there is an error in my logic so maybe u guys can write a better script, alot of you who replied to my help topic suggested that i make a request so here it is

ok what it is:
Flame Race Mode: Players get a flame gun which is already set up as a booster, this is forced on them when they join

admins set where the start/finish line goes, and can set up any number of checkpoints in order to set up a circuit on any map, admin can also set a number of laps for that map,

players must pass through ALL checkpoints In Order to begin next lap or finish the race, when the first player crosses the finish at the end of their final map, the map changes

as for team, they need to be in the normal team (ie: Team5, Not in any colored Teams), because i will add in items that the players can use against eachother, however, there will be a 30 second set up time for all players before the race, during this time all players are in Red Team, this is when they set up items, when the race has started players will not be able to place items. A few items that i think would be good for you guys to add as it will help me learn to code are:
Item #1 = Flares (great for diversions): A Player sets some of these down before the race begins, during the race, if the player comes like 10 metres from it, it "magnetises" and the flares position becomes the players position until it gets triggered, there is a 3 second "calibration" period, in which time it will not trigger (nothing will happen except a Drawtext telling the player that the flare is calibrating, just for effect ;)), only one flare will magnetise to the player unless the one that they do have triggers beforehand:
how it will be triggered: if another racer comes within 50 metres of the player, in line of sight, 10 cluster pellets launch from the player who has the flare to the player who just came into range
hit effect: harmless but capable of sending the victim flying in a completely different direction

Item # 2 = Sticky MOAB: Player sets this down on the ground, when a player comes into range, it "magnetizes" to the player and they become a bomb, when the timer goes to 0 the player dies in a frightening explosion, also capable of taking out large groups of racers, Players will be able to set this down once a map, however, only ONE player can set one down each map, and there is a 5% chance that the bomb will be diffused by the player when it magnetizes, and the other catch is, you cant place it in line of sight of the finish line, but where the victim ends up doesnt matter

when a racer is killed, either by suicide or one of the items, they are moved to spectators until next map

also, there is a 5 second delay before the race begins, in that 10 seconds, all players positions are frozen to the position of the start line, and in the final 3 to 1 countdown(6 seconds), the 3 to 1 countdown appear via Massive DrawText in the centre of the screen every 2 seconds, colors would look like this: 3, 2, 1, GO!, on Go, players positions are instantly unfrozen so the race begins

pity theres no way to add sounds for the drawtext events just before the race, so something like: Bing, Bing, Bing, Dong! ah well, i guess thats another good suggestion for the next version of soldat

also, something im not sure how to do in this case: Dynamic Placings, the players current race position is displayed on console whenever they complete a map, also maybe add a toggle command which shows the player their dynamic race place once every second via DrawText, until they decide to turn it off

ill add the rest


thanks in advance
« Last Edit: September 07, 2010, 01:16:51 am by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: [Request] Flame Race Mode
« Reply #1 on: September 08, 2010, 10:24:04 am »
Why don't you just use PerroRace and modify it?

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: [Request] Flame Race Mode
« Reply #2 on: September 08, 2010, 11:00:07 pm »
hmm i suppose...
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: [Request] Flame Race Mode
« Reply #3 on: September 28, 2010, 01:13:52 am »
i cant seem to find how players are detected at checkpoints, can anyone please point it out?
check out my server! click here

If at first you don't succeed, Improvise! :D

DarkCrusade

  • Guest
Re: [Request] Flame Race Mode
« Reply #4 on: September 29, 2010, 12:38:41 am »
You can check if he's in a certain distance from a point (that is your saved waypoint). In your case I'd stick with

Code: [Select]
function Distance(X1,Y1,X2,Y2):Single;

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: [Request] Flame Race Mode
« Reply #5 on: September 29, 2010, 08:00:20 am »
You can check if he's in a certain distance from a point (that is your saved waypoint). In your case I'd stick with

Code: [Select]
function Distance(X1,Y1,X2,Y2):Single;

PerroRace uses angles to check whether players passed the point during last second(at least the version I have). Don't know what would you need that info for though, frosty.

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: [Request] Flame Race Mode
« Reply #6 on: September 29, 2010, 02:16:20 pm »
I have a private running script that i keep for myself and i used Distance. But it will be able to detect checkpoints through polies.. But that can be fixed with Angles.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: [Request] Flame Race Mode
« Reply #7 on: September 29, 2010, 10:57:17 pm »
You can check if he's in a certain distance from a point (that is your saved waypoint). In your case I'd stick with

Code: [Select]
function Distance(X1,Y1,X2,Y2):Single;

PerroRace uses angles to check whether players passed the point during last second(at least the version I have). Don't know what would you need that info for though, frosty.

Gizd, i was waiting for you to ask that, :D and the reason i need this is, i want the checkpoints to work from line-of-sight, not just distance, if that makes sense, so i need to know what section of code it is so i can change the Distance to Raycast (if hes used Distance that is)

Vince (or someone) how would i use these angles? for future ref

ive set up a few race maps and found out how to make it detect people who arent exactly on the point, but its seeing everyone through polys, not what i want and its ruined the race maps until i can change it

thanks in advance guys
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: [Request] Flame Race Mode
« Reply #8 on: September 30, 2010, 05:05:08 pm »
You'd like to use that :

function RayCast(P1X,P1Y,P2X,P2Y: Single; var Distance: Single;MaxDist: Integer): Boolean;

If it's true then P1 sees P2. As easy as it is..

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: [Request] Flame Race Mode
« Reply #9 on: October 01, 2010, 01:31:32 am »
the question is, what section of code do i need to change in perrorace? i know about the raycast, in fact ive made a custom function which makes it easier to use when checking if a particular ID is visible from a certain X Y coord, if anyones interested

ive been using this in my shop for a while now

Code: (pascal) [Select]
const
T=True;
F=False;


function CheckPlayerDist(ID:Byte;X,Y,Distance:Integer):Boolean;
var Dist:Single;
begin
  if RayCast(GetPlayerStat(ID,'x'),GetPlayerstat(ID,'y'),X,Y,Dist,Distance) then Result:=T;
end;

Checks if player ID is visible from X Y within the given Distance

(for the new coders) instead of using "if raycast(...) then" use "if CheckPlayerDist(...) then"
easier to remember huh? ;)


« Last Edit: October 01, 2010, 01:34:43 am by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: [Request] Flame Race Mode
« Reply #10 on: October 01, 2010, 08:52:04 am »
Did you expect that now I'm going to ask why would you need checkpoint check via sight?

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: [Request] Flame Race Mode
« Reply #11 on: October 01, 2010, 10:03:24 am »
Did you expect that now I'm going to ask why would you need checkpoint check via sight?
its seeing everyone through polys, not what i want

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: [Request] Flame Race Mode
« Reply #12 on: October 01, 2010, 12:51:33 pm »
Besides that it'll fail when you already passed the checkpoint and there's a poly in beetween you and the point...

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: [Request] Flame Race Mode
« Reply #13 on: October 02, 2010, 01:30:16 am »
can it be changed or not? cut to the chase plz, i feel like were going around in circles here

single word, yes or no, ill figure out the rest from there k?

edit: thanks for quoting me dnmr :D
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: [Request] Flame Race Mode
« Reply #14 on: October 02, 2010, 06:03:11 am »
What do you want to change?

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: [Request] Flame Race Mode
« Reply #15 on: October 02, 2010, 06:05:59 am »
I want to change how players are detected when they pass through checkpoints

but i want to use Raycast NOT Distance

but i dont know what section of code to change

thanks in advance
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: [Request] Flame Race Mode
« Reply #16 on: October 02, 2010, 09:03:13 am »
I don't have time to read and understand all the code atm, so i'll just write that RayCast is very, very buggy function and i would recommend you not to use it in races. Might just lie about checkpoints. If you want RayCast to work properly, i found it helpful to put them in a loop, lowering the max distance every time. Then if any RayCast returned true, general function was true. Seriously, try for example using RayCast with 700 MaxDist and then stand 10 points from the RayCast starting point. I'm 90% sure it will return false.

Tested in my Single Flashbang script, feel free to check it.
« Last Edit: October 02, 2010, 09:04:47 am by Mighty »
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: [Request] Flame Race Mode
« Reply #17 on: October 02, 2010, 08:29:52 pm »
alright ill just go through all the code, tx mighty
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline tk

  • Soldier
  • **
  • Posts: 235
Re: [Request] Flame Race Mode
« Reply #18 on: October 03, 2010, 12:00:56 pm »
Quote
i'll just write that RayCast is very, very buggy function
RayCast is 100% working function, ofc if used in proper way.

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: [Request] Flame Race Mode
« Reply #19 on: October 03, 2010, 02:51:36 pm »
Besides that it'll fail when you already passed the checkpoint and there's a poly in beetween you and the point...
That's the reason I'd just leave it as it is because it's good.