Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Commands->Set_Facing
Commands->Set_Facing [message #428721] Tue, 18 May 2010 20:13 Go to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

Does this function currently work? I thought it did, but every time I use it, it doesn't crash the server but simply does nothing... does it not take a regular GameObject?

-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Commands->Set_Facing [message #428727 is a reply to message #428721] Tue, 18 May 2010 22:51 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

I talked to some people and it appears to only work on certain types of objects, infantry being excluded. Is there any way I could replace this functionality for use with infantry?

-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Commands->Set_Facing [message #428733 is a reply to message #428721] Wed, 19 May 2010 00:57 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
Try setting the looking at location instead for infantry, I can't remember the names of the functions off the top of my head but it lets you set where the infantry unit is 'looking', hence setting the direction it's facing in.

Quick bit of maths to determine the x,y,z of a location 1m from the unit in the direction you want it to face should be all you need.



EDIT: I think it's called something like Force_Camera_Look_Player, but IIRC it should work for AI too.... give it a try.


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Wed, 19 May 2010 01:02]

Report message to a moderator

Re: Commands->Set_Facing [message #428740 is a reply to message #428721] Wed, 19 May 2010 02:17 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

Force_Camera_Look_Player is not what you want. You pass it the GameObject for a player and it forces that players camera to face and look at a given position.
Set_Facing should work just fine for infantry, I know its been used for infantry before.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Commands->Set_Facing [message #428742 is a reply to message #428740] Wed, 19 May 2010 04:51 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

jonwil wrote on Wed, 19 May 2010 04:17

Force_Camera_Look_Player is not what you want. You pass it the GameObject for a player and it forces that players camera to face and look at a given position.
Set_Facing should work just fine for infantry, I know its been used for infantry before.


That's what I thought, but apparently it never worked properly according to a few people (one said it only worked on star objects), and we've tested it multiple times so I can't figure out what's up. Set_Position works perfectly, but Set_Facing simply does nothing.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Commands->Set_Facing [message #428743 is a reply to message #428721] Wed, 19 May 2010 05:03 Go to previous messageGo to next message
Sladewill is currently offline  Sladewill
Messages: 291
Registered: January 2009
Location: United Kingdom
Karma: 0
Recruit

Set Facing works totally fine for me. Hes probably trying to move the wrong gameobj

FT-Owners - Sladewill,Snazy2007,Willdy
http://FT-Gaming.com for more info...
Re: Commands->Set_Facing [message #428755 is a reply to message #428743] Wed, 19 May 2010 08:55 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

Sladewill wrote on Wed, 19 May 2010 07:03

Set Facing works totally fine for me. Hes probably trying to move the wrong gameobj

Set_Position works on the same GameObject pointer so no, I'm not using the wrong object.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Commands->Set_Facing [message #428771 is a reply to message #428721] Wed, 19 May 2010 10:12 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
Just a thought... have you tried introducing a delay between Set_Position and Set_Facing? It's plausible that for infantry units you can't do them both in the same engine tick for whatever reason.... either try setting the facing only, or use a delayed custom to trigger the Set_Facing call on the next engine tick (ie: 0.001 second delay)

I know I have found cases like this with other things in the engine, where trying to do two things at once to an object either caused one of the two to fail or the game to simply crash.


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Wed, 19 May 2010 10:13]

Report message to a moderator

Re: Commands->Set_Facing [message #428772 is a reply to message #428771] Wed, 19 May 2010 10:23 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
Set_Facing works fine

Commands->Set_Facing(o, 130);


goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: Commands->Set_Facing [message #428774 is a reply to message #428771] Wed, 19 May 2010 10:34 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

danpaul88 wrote on Wed, 19 May 2010 12:12

Just a thought... have you tried introducing a delay between Set_Position and Set_Facing? It's plausible that for infantry units you can't do them both in the same engine tick for whatever reason.... either try setting the facing only, or use a delayed custom to trigger the Set_Facing call on the next engine tick (ie: 0.001 second delay)

I know I have found cases like this with other things in the engine, where trying to do two things at once to an object either caused one of the two to fail or the game to simply crash.

I tried exactly that, I originally had the Set_Position and Set_Facing functions called by a single SSGM chat hook, but I split it up into two and tried the Set_Facing part separately... didn't work.

That's exactly how I called it Hex (minus the variable name), but it just doesn't work. It's not like I'm passing it an invalid argument or anything else it would have crashed by now... it simply doesn't do anything.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

[Updated on: Wed, 19 May 2010 10:35]

Report message to a moderator

Re: Commands->Set_Facing [message #428799 is a reply to message #428721] Wed, 19 May 2010 15:33 Go to previous messageGo to next message
Sladewill is currently offline  Sladewill
Messages: 291
Registered: January 2009
Location: United Kingdom
Karma: 0
Recruit

have u tried using a different ssgm source

FT-Owners - Sladewill,Snazy2007,Willdy
http://FT-Gaming.com for more info...
Re: Commands->Set_Facing [message #428801 is a reply to message #428799] Wed, 19 May 2010 15:37 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
Post your source

goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: Commands->Set_Facing [message #428914 is a reply to message #428721] Fri, 21 May 2010 02:19 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
Commands->Set_Position(o,Vector3(101,-34,-7)); Force_Camera_Look_Player(o, 129);


Can someone try this because it gives me really odd results


goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz

[Updated on: Fri, 21 May 2010 02:45]

Report message to a moderator

Re: Commands->Set_Facing [message #428915 is a reply to message #428914] Fri, 21 May 2010 02:43 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
Hex wrote on Fri, 21 May 2010 10:19

Commands->Set_Position(o,Vector3(101,-34,-7)); Force_Camera_Look_Player(o, 129);


Can someone try this because it gives me really odd results



Ignore that bit about Force_Camera_Look_Player, it's not exactly what I was thinking it was... bit of a brain fart moment.



EDIT: Just a thought... is Set_Facing expecting a value in degrees or radians? If it's expecting radians that's probably why it's not working properly. I would assume it's degrees but you never know...


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Fri, 21 May 2010 02:45]

Report message to a moderator

Re: Commands->Set_Facing [message #428916 is a reply to message #428721] Fri, 21 May 2010 02:44 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
So was I, Force_Camera_Look_Player should NOT be used

goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: Commands->Set_Facing [message #428938 is a reply to message #428916] Fri, 21 May 2010 09:18 Go to previous messageGo to next message
0x90
Messages: 142
Registered: September 2006
Location: Germany
Karma: 0
Recruit
Hex wrote on Fri, 21 May 2010 11:44

So was I, Force_Camera_Look_Player should NOT be used


yes, because its evil! Wink oh no, wait... force_camera_look was for the aimbot! stupid me Razz

Re: Commands->Set_Facing [message #428940 is a reply to message #428938] Fri, 21 May 2010 10:04 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

0x90 wrote on Fri, 21 May 2010 11:18

Hex wrote on Fri, 21 May 2010 11:44

So was I, Force_Camera_Look_Player should NOT be used


yes, because its evil! Wink oh no, wait... force_camera_look was for the aimbot! stupid me Razz



I had a feeling it was at least similar to that particular function...

On topic though: pretty sure this function's broken. I got what I needed through other means, but yeah. No cigar.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Commands->Set_Facing [message #429056 is a reply to message #428721] Sat, 22 May 2010 14:59 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
Just a thought: you weren't trying to use this on AI bots were you? If you were the bots would have simply turned around again to face the direction the AI wants to face in and ignore the facing you were setting... You would have to use the ActionParamsStruct and related functions to instruct the AI to face a particular direction.

http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Sat, 22 May 2010 15:00]

Report message to a moderator

Re: Commands->Set_Facing [message #429115 is a reply to message #429056] Sun, 23 May 2010 08:39 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

danpaul88 wrote on Sat, 22 May 2010 16:59

Just a thought: you weren't trying to use this on AI bots were you? If you were the bots would have simply turned around again to face the direction the AI wants to face in and ignore the facing you were setting... You would have to use the ActionParamsStruct and related functions to instruct the AI to face a particular direction.

Nope, it was being used on the GameObject of whatever player used the command.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Commands->Set_Facing [message #429295 is a reply to message #429115] Tue, 25 May 2010 06:19 Go to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3812
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Set_Facing works on all human and vehicle objects except for infantry that are controlled by the player, which it still works for, the players camera just instantly override the Set_Facing command, rotating the player's character back to what their camera is facing.

float PI = 3.14159265f,Facing = 90.0f;
Vector3 pos = Commands->Get_Bone_Position(obj,"c head");
pos.X += 20.0f*(cos(Facing*PI/180));
pos.Y += 20.0f*(sin(Facing*PI/180));
Force_Camera_Look_Player(obj,pos);


Previous Topic: Flag w3d
Next Topic: Renegade beta vid?
Goto Forum:
  


Current Time: Wed Dec 18 22:05:17 MST 2024

Total time taken to generate the page: 0.01322 seconds