force thingy

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

force thingy

Post by darksmaster923 »

i made a script so that when the mouse clicks, the pawn forces to a dir but when i put positiontoplayer it doesnt force
script part

Code: Select all

							case 2
							{
								MatchPlayerAngles();
								ForceLeft(10);
								PlayerToPosition(0, 0, 0); 
                                                            //if i put PositionToPlayer(float OffsetX, float OffsetY, float OffsetZ ); it doesnt force but i need it to be at the player & to force
							}
							case 3
							{
								MatchPlayerAngles();
								ForceRight(10);
								PlayerToPosition(0, 0, 0); 
							}
Herp derp.
User avatar
zany_001
Posts: 1047
Joined: Fri Mar 02, 2007 8:36 am
Location: Aotearoa

Post by zany_001 »

Maybe swap ForceRight(10); with PlayerToPosition(0, 0, 0);i dont know enough though
Once I was sad, and I stopped being sad and was awesome instead.
True story.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

i tried that it works fine execpt that the player glitches though the wall very easily
Herp derp.
User avatar
zany_001
Posts: 1047
Joined: Fri Mar 02, 2007 8:36 am
Location: Aotearoa

Post by zany_001 »

You mean what i said worked?!?!?!

***EDIT***
Perhaps if there is a command called something like getDisWall() which gets the distance to neareast wall(i didnt look too hard so it might exist):

Code: Select all

if getDisWall()==2
        {
         forceRight("Forcebackwall")
         }

{
if forceApllied("true")
       {
        Forcebackwall=forceAplliedAmount
       }
else Forcebackwall=1
}

             
And everytime you applied a force, you would define forceApllied as true,and forceAplliedAmount as the amount of force applied(in your case 10)and when the force ended, then define forceApllied as false.
might not work though
(the script was messy i know but in still learning :oops: )
Once I was sad, and I stopped being sad and was awesome instead.
True story.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

zany_001 wrote:You mean what i said worked?!?!?!

***EDIT***
Perhaps if there is a command called something like getDisWall() which gets the distance to neareast wall(i didnt look too hard so it might exist):

Code: Select all

if getDisWall()==2
        {
         forceRight("Forcebackwall")
         }

{
if forceApllied("true")
       {
        Forcebackwall=forceAplliedAmount
       }
else Forcebackwall=1
}

             
And everytime you applied a force, you would define forceApllied as true,and forceAplliedAmount as the amount of force applied(in your case 10)and when the force ended, then define forceApllied as false.
might not work though
(the script was messy i know but in still learning :oops: )
well i tried it before
the thing with getting the nearest wall, tried that too. it doesnt work. It gets me away from one wall but glitches me into another.
Herp derp.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

okay, gots a solution
i added a random value 1,10 < 3 position to player and works
this also lets me clean up my very messy script
Herp derp.
User avatar
zany_001
Posts: 1047
Joined: Fri Mar 02, 2007 8:36 am
Location: Aotearoa

Post by zany_001 »

Whats the script for?
Once I was sad, and I stopped being sad and was awesome instead.
True story.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

to make the player automatically move to fake inaccuracy
Herp derp.
User avatar
zany_001
Posts: 1047
Joined: Fri Mar 02, 2007 8:36 am
Location: Aotearoa

Post by zany_001 »

Couldnt you just apply a random force to the projectlie?
[/code]
Once I was sad, and I stopped being sad and was awesome instead.
True story.
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

no
Herp derp.
Post Reply