PDA

View Full Version : [U Script] Turn away from nades


RuffianSoldier
27th December 2005, 23:00
This is an incomplete version of my "Turn Away From Nades" code...
The point of this is to get you guys thinking - which is why it is incomplete.
YOU HAVE TO FINISH IT! Im not gonna give you guys everything....

Things you need/should add (To finish it):
Auto run
Check walls
More acurate vectoring
Anything else that might be a good idea

All the code is mine, but if it werent for [RAM]Reggin' and [RAM]dtp' I would not know as much about .u script - so they definatly get credits!

Add this to your vars:

Var Config Int Area;


Call this from postrender or tick or whatever:

Function CheckNades ()
{
Local R6Grenade G;
ForEach MPC.AllActors(Class 'R6Grenade',G)//Iterate through all grenades
If(G.GetStateName() == 'R6FragGrenade')//Make sure the grenade is a frag
RunAway(G,True,True);//Call Runaway function
}



Now for the main function.
Info:
bWhenVisible will only turn you around if the grenade is can be FastTraced
Use bInArea if you only want to run away when it gets close (i recomend this)


Function RunAway (R6Grenade G, Bool bWhenVisible,Bool bInArea)
{
Local Vector MyLoc,GLoc;//Vectors
MyLoc=Me.m_vEyeLocation;//Vector define
GLoc=G.Location;//Vector define

If(bInArea) //Check to see if bool is true
If(Int(VSize(GLoc - MyLoc) / 48) >= Area) //Check to see if the grenade greater or equal to "Area" (How far away it is)
Return; //If the above is true (if it is too far to worry about), then return (dont do anything)

If(bWhenVisible)//Check to see if bool is true
If(MPC.FastTrace(MyLoc,GLoc)) //Check to see if the grenade is visible
R6Pawn(Me).PawnLookAt(MyLoc - GLoc); //If it is visible - then turn around
Else //If bWhenVisible is not true
R6Pawn(Me).PawnLookAt(MyLoc - GLoc);//Turn around
}


A good "Area" would be 15-20 - if the grenade is under 10 you will get blown up, and you need time to run away.
So put this in defaultproperties:

Area=20


BTW - I was testing out R6Pawn.PawnLookAt, PawnLookAbsolute or even SetRotation might be a better choice- but I dont think it will matter too much.

Also:
This code is great for avoiding flash bangs - if you choose to do this, you will need to check the grenades GetStateName()
-I think you know what you are lookin for ;-)

Do not ask me for help - because I am releasing this so people can learn, not so they can take hand outs and think they are leet

GLoGG
27th December 2005, 23:08
This is an incomplete version of my "Turn Away From Nades" code...
The point of this is to get you guys thinking - which is why it is incomplete.
YOU HAVE TO FINISH IT! Im not gonna give you guys everything....

Things you need/should add (To finish it):
Auto run
Check walls
More acurate vectoring
Anything else that might be a good idea

All the code is mine, but if it werent for [RAM]Reggin' and [RAM]dtp' I would not know as much about .u script - so they definatly get credits!

Add this to your vars:

Var Config Int Area;


Call this from postrender or tick or whatever:

Function CheckNades ()
{
Local R6Grenade G;
ForEach MPC.AllActors(Class 'R6Grenade',G)//Iterate through all grenades
If(G.GetStateName() == 'R6FragGrenade')//Make sure the grenade is a frag
RunAway(G,True,True);//Call Runaway function
}



Now for the main function.
Info:
bWhenVisible will only turn you around if the grenade is can be FastTraced
Use bInArea if you only want to run away when it gets close (i recomend this)


Function RunAway (R6Grenade G, Bool bWhenVisible,Bool bInArea)
{
Local Vector MyLoc,GLoc;//Vectors
MyLoc=Me.m_vEyeLocation;//Vector define
GLoc=G.Location;//Vector define

If(bInArea) //Check to see if bool is true
If(Int(VSize(GLoc - MyLoc) / 48) >= Area) //Check to see if the grenade greater or equal to "Area" (How far away it is)
Return; //If the above is true (if it is too far to worry about), then return (dont do anything)

If(bWhenVisible)//Check to see if bool is true
If(MPC.FastTrace(MyLoc,GLoc)) //Check to see if the grenade is visible
R6Pawn(Me).PawnLookAt(MyLoc - GLoc); //If it is visible - then turn around
Else //If bWhenVisible is not true
R6Pawn(Me).PawnLookAt(MyLoc - GLoc);//Turn around
}


A good "Area" would be 15-20 - if the grenade is under 10 you will get blown up, and you need time to run away.
So put this in defaultproperties:

Area=20


BTW - I was testing out R6Pawn.PawnLookAt, PawnLookAbsolute or even SetRotation might be a better choice- but I dont think it will matter too much.

Also:
This code is great for avoiding flash bangs - if you choose to do this, you will need to check the grenades GetStateName()
-I think you know what you are lookin for ;-)

Do not ask me for help - because I am releasing this so people can learn, not so they can take hand outs and think they are leet

nice job there ruffian ;)

also a great idea turn away from flashes so not get flashed or sumthin... i had VRLBot's esp checking for those statenames i think i got all explosive shit in there...

if (r6grenade.GetStateName() == 'R6FragGrenade' || r6grenade.GetStateName() == 'R6ClayMoreUnit' || r6grenade.GetStateName() == 'R6BreachingChargeUnit'
|| r6grenade.GetStateName() == 'R6RemoteChargeUnit')
{
VLRCanvas.SetDrawColor(255,0,255);
VLRCanvas.SetPos(ScreenPosX + 10, ScreenPosY + 10);
VLRCanvas.DrawText(">>> LOOK OUT! <<<");
}

anywayz i thought it would be a cool idea since this is working (as from what u said)

valenti1232289
28th December 2005, 01:54
Haha, cool and sweet ;)

superdupe
28th December 2005, 02:05
gj ruffian...

KizZamP-
28th December 2005, 10:50
wow nice code && idea ^^
hell i wish i could edit my thread,but i haven't done that in 2 weeks -.-
good job !

superdupe
28th December 2005, 18:46
this is a really doable hack... ill see if i can work on it...

ALBerT
28th December 2005, 19:04
yeah tis a good idea, hope to see a completed release to mess around with. My personal method of evading nades is called RUN AWAYYYYYY!!

superdupe
28th December 2005, 19:16
lol i got most of it working...
also, i redesigned the code so that my eyes can read it easier
its so much fun...also, i make it turn on speedhack if i really need to get away....good stuff ruffian

RuffianSoldier
28th December 2005, 19:30
nice, superdupe!

Here is what I use for auto run: MPC.aForward+=300;
You could also lock on to the nade and do aBackward+=300

KizZamP-
28th December 2005, 20:06
yup i did that too ^^
i knew such things worked because of a recent thread in the aa section of someone saying you can do that stuff,it was in griffaby version 3.

Fishy
28th December 2005, 21:27
Very nice.. Way to help noobs like me out...

Thanks

superdupe
29th December 2005, 17:18
yup i did that too ^^
i knew such things worked because of a recent thread in the aa section of someone saying you can do that stuff,it was in griffaby version 3.

i thought you would have come up with that yourself..

KizZamP-
29th December 2005, 17:46
i already knew about that MyController.aForward around 2 months ago,but didn't do anything with it.
then i saw a thread in aao section called : "movement", and that guy was asking for such things, some people told MyController.aForward works for moving to a certain waypoint.So i made a thing that it automatically moves towards the targetlocation.

DotProduct
29th December 2005, 20:28
congradulations kizzamp... nj ruffian

superdupe
30th December 2005, 05:44
i was able to use some code from the [RAM] waypoint bot to help out with the wall adjustment

itwasfunny
30th December 2005, 12:59
very nice ideia..

RuffianSoldier
30th December 2005, 20:21
yup i did that too ^^
i knew such things worked because of a recent thread in the aa section of someone saying you can do that stuff,it was in griffaby version 3.

Yeah, but you didnt find it out yourself.................

GLoGG
30th December 2005, 21:02
Yeah, but you didnt find it out yourself.................
who cares about that ruffian?.. btw tried that turn away from nades out.. with that aforward thingy works good fun to play with gj there bro.

KizZamP-
30th December 2005, 21:18
Yeah, but you didnt find it out yourself.................
what is your ****ing problem dude?
i found the aforward and astrafe in the aao and rvs engine hella long ago.
but i didn't touch it, because i had no need for it(though i KNEW it should of worked).
but you made a function that could make use of those things, ain't i allowed to say what i want?
you don't have anything to say here.

RuffianSoldier
19th January 2006, 19:40
btw everyone - this can be ported to any U script game with nades - all you gotta do is find the name of grenades and change everything that checks for R6Grenade....
It will work in Americas Army, Red Orchestra (and other UT mods), Swat 4 etc

ReckaH
21st January 2006, 04:09
nice job there ruffian ;)

also a great idea turn away from flashes so not get flashed or sumthin... i had VRLBot's esp checking for those statenames i think i got all explosive shit in there...

if (r6grenade.GetStateName() == 'R6FragGrenade' || r6grenade.GetStateName() == 'R6ClayMoreUnit' || r6grenade.GetStateName() == 'R6BreachingChargeUnit'
|| r6grenade.GetStateName() == 'R6RemoteChargeUnit')
{
VLRCanvas.SetDrawColor(255,0,255);
VLRCanvas.SetPos(ScreenPosX + 10, ScreenPosY + 10);
VLRCanvas.DrawText(">>> LOOK OUT! <<<");
}

anywayz i thought it would be a cool idea since this is working (as from what u said)


Or you could just remove the effects.. :ermm:

KizZamP-
21st January 2006, 11:06
correct reckah,but i think he wants to turn away from it because he always aimbots...it would be a bit obvious to see the flash and then own someone.

akira21
22nd January 2006, 03:25
i cant even remember the last time i looked in a flash bang so =\

RuffianSoldier
22nd January 2006, 10:27
Dont use it for flashbangs if you dont want to..... but it works great for frag evasion

GLoGG
22nd January 2006, 12:44
Or you could just remove the effects.. :ermm:

wouldn't this look allot legiter than just removing the effect?... i mean common its just an idea.. use an aTurn instead of the actual rotator would make it a nice rotation and not too fast soo people wont get the wrong idea's.

RuffianSoldier
22nd January 2006, 19:26
usually when I manually look away from flash bangs I jurk my mouse as fast as I can - So I doubt anyone will notice

ReckaH
23rd January 2006, 06:00
wouldn't this look allot legiter than just removing the effect?... i mean common its just an idea.. use an aTurn instead of the actual rotator would make it a nice rotation and not too fast soo people wont get the wrong idea's.


I never try to play legit lol :ermm: It is a good idea though. I messed with drawing the radius around the damage point of frags,c4,etc. Another good thing to do is change the color of the distance esp on them if you get too close. I believe all the damage radius was easy to find in the .u's , it was awhile ago when I did it though.

RuffianSoldier
23rd January 2006, 08:38
Not a bad idea - a nice smooth color transition.... it gets red when its in death range.....

frikos
23rd January 2006, 16:19
i made it once with a skin hack --> green: not dangerous, blue: gimp, red: definitly dead
you can also draw on the esp the "nade-timer" --> R6FragGrenade.m_fTimerCounter :cross-eye

but as for the distance & danger of a frag you have too see that you're not taking the same damage for each "stance", so you're just gimped while standing and killed while crouching for example ;)

RuffianSoldier
23rd January 2006, 19:15
One thing is for sure - someone should release a public hack with my run-away-from-nades in it.... I would but Im done releasing anything for RvS