Page 1 of 2

Rotating a spawned Object

Posted: Wed Mar 04, 2009 4:23 pm
by HeavenBound
Hey, I'm making a mod, similar to something like the old James Bond Games....


Here's an example

Code: Select all


//------------Shotgun-----------------------

shotgun:

local.trig = spawn trigger_multiple targetname triggerit 
local.trig.origin = ( -789 2436 -113 )
local.trig setsize ( -10 -10 -10 ) ( 10 10 10 )
local.trig setthread got_shotgun
local.trig wait 2

local.shotgun = spawn script_model targetname shotgun 
local.shotgun model "weapons/shotgun.tik"
local.shotgun.origin = ( -789 2436 -113 )
local.shotgun.scale = 1.0

end
I want the shotty (along with the rest of the weapons) to rotate in the air. I know its done with .angles...but i'm not sure what to put.

Thanks in advance. =)

Posted: Wed Mar 04, 2009 6:17 pm
by $oldier Of Ra
Maybe one of these will do:

Code: Select all

rotateX ( Float avelocity )     
Rotate about the x axis at the specified angular velocity.

rotateY ( Float avelocity )     
Rotate about the y axis at the specified angular velocity. 

rotateZ ( Float avelocity )     
Rotate about the z axis at the specified angular velocity.

Basically, use a float (or integer) to represent to what degree you want the object to rotate. "local.object rotateZ 360.0" will make it turn around (direction of it's Z angle) a full circle.

Cheers!

Posted: Thu Mar 05, 2009 2:54 am
by HeavenBound
ugh...Most of my weapons are spawning below the map...I raise their .origin (last number) but I get nothing. =\

Posted: Thu Mar 05, 2009 1:13 pm
by Tazz
make sure u r going the right way....u know sometimes when working with - origins u have to actually lower the number to get what u want meaning -113 might have to be -83 instead of -163....or vice versa...try going in both direction

Posted: Thu Mar 05, 2009 3:41 pm
by $oldier Of Ra
That's called basic maths Tazz :) Besides, the engine will do just that if you add "+ ( 0 0 40 )" after the origin you specified.

Posted: Thu Mar 05, 2009 9:42 pm
by HeavenBound
Well, I added to the last number (Z) and it ended up spawning the rifle in the Center Building Roof Balcony, when the origin is at Southeast path...It was rotating, but dunno why it spawned there...

I'm assuming X = Lenght, Y = Width, and Z = Height...please correct me if I'm wrong.

Thanks.

Posted: Fri Mar 06, 2009 8:22 pm
by $oldier Of Ra
And you noted down the coords with "whereami" enabled? Then it should be accurate. Show this origin and I'll see if it's the same on my game.

Posted: Fri Mar 06, 2009 8:36 pm
by HeavenBound
wherami 1 does nothing on my game..I just type in coord.


Is there a difference? Something I'm missing lol...

I don't have the coord anymore, I redid them all and now none of them are spawning anywhere visible lol.

Posted: Sat Mar 07, 2009 9:33 am
by $oldier Of Ra
Oh, an SH/BT user... That's the one of the reason why I never mod on those games. Getting coords is annoying work.

Posted: Sat Mar 07, 2009 9:47 am
by Aprop
$oldier Of Ra wrote:Oh, an SH/BT user... That's the one of the reason why I never mod on those games. Getting coords is annoying work.
What? I modding bt since got moh!! But i never had such problems with coords....

Posted: Sat Mar 07, 2009 3:09 pm
by $oldier Of Ra
No problem with the coords, just getting the coords is annoying since I need to type "coord" in the console over and over and over....

Posted: Sat Mar 07, 2009 3:40 pm
by HeavenBound
lol, I'm not a Sh/BT user. Strictly AA....and its not working.

I've tried using coord and viewpos. Nothing is working. My guns aren't showing up!! =(

Posted: Sat Mar 07, 2009 3:51 pm
by Tazz
do like sor said....get a ss of the place or places u want the weapon and we can get u the coords for the place....with the coords in ur post up top that is nowhere ne se path if ur talking about the algiers map....either way take a screenshot of the place and then go from there

Posted: Sat Mar 07, 2009 6:32 pm
by HeavenBound
I got 1 to show up! But then when I added the rest in, the mod failed lol...I'll go take some SS's.

Posted: Sat Mar 07, 2009 8:57 pm
by $oldier Of Ra
Wait, wait, let me get this straight, you use AA but don't use whereami to get your coordinates?

NO screenshots, show me the script! Let me see what you're doing wrong.