Posts: 26
Threads: 6
Joined: Aug 2013
Reputation:
1
Hello, sorry for my second post in this section in the last few days, I'm not trying to spam i swear.
I want to make a player press the +forward key when the waittill is completed. for example:
Code: example()
{
self notifyOnplayerCommand( "example", "+example" );
self waittill("example");
+forward; ???????
}
could anyone tell me how i could make this code work?
Posts: 2,157
Threads: 120
Joined: Apr 2011
Reputation:
71
Not possible in Mw2 afaik, at least not through gsc scripting. There's a slight chance it might work through .menu scripting if you're using a copy of what 4d1 was until it shut down.
However, best you can do is to is use a workaround in this case. Use the moveto thingy you asked about in your last thread, but get the anglestoforward for the origin. Look up @ Yamato 's tutorials about bullettrace!
Posts: 3,535
Threads: 420
Joined: Dec 2010
Reputation:
106
07-06-2014, 14:04
(This post was last modified: 07-06-2014, 14:05 by Yamato.)
No, you cant do that in MW2, to move forward I think you could use something similar to what I used in my AI zombies code to detect walls and ground. You might modify a bit those numbers I put in bold for a better functioning, try them as they are and if it doesnt work well change them a bit.
Code: forwardangles = self.origin + ( 0, 0, 25 ) + anglestoforward( self.angles ) * 25;
frontal = bullettrace( self.origin + (0 , 0, 50 ), forwardangles, false, self );
final = bullettrace( forwardangles, forwardangles - ( 0, 0, 200 ), false, self);
if ( frontal["fraction"] == 1 && frontal["surfacetype"] == "default" )
self SetOrigin( final["position"] );
EDIT: bold didnt work, I mean the last numbers in those ( 0, 0, X )
Posts: 26
Threads: 6
Joined: Aug 2013
Reputation:
1
(07-06-2014, 14:04)Yamato Wrote: No, you cant do that in MW2, to move forward I think you could use something similar to what I used in my AI zombies code to detect walls and ground. You might modify a bit those numbers I put in bold for a better functioning, try them as they are and if it doesnt work well change them a bit.
Code: forwardangles = self.origin + ( 0, 0, 25 ) + anglestoforward( self.angles ) * 25;
frontal = bullettrace( self.origin + (0 , 0, 50 ), forwardangles, false, self );
final = bullettrace( forwardangles, forwardangles - ( 0, 0, 200 ), false, self);
if ( frontal["fraction"] == 1 && frontal["surfacetype"] == "default" )
self SetOrigin( final["position"] );
EDIT: bold didnt work, I mean the last numbers in those ( 0, 0, X )
Thanks for the help man : )
|