Post your scripting questions / solutions here
Moderator: Moderators
HeavenBound
Colour Sergeant
Posts: 85 Joined: Thu Sep 11, 2008 12:55 am
Post
by HeavenBound » Wed Mar 04, 2009 4:23 pm
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. =)
HeavenBound
I'm new at this
$oldier Of Ra
Lieutenant Colonel
Posts: 404 Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:
Post
by $oldier Of Ra » Wed Mar 04, 2009 6:17 pm
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!
HeavenBound
Colour Sergeant
Posts: 85 Joined: Thu Sep 11, 2008 12:55 am
Post
by HeavenBound » Thu Mar 05, 2009 2:54 am
ugh...Most of my weapons are spawning below the map...I raise their .origin (last number) but I get nothing. =\
HeavenBound
I'm new at this
Tazz
Second Lieutenant
Posts: 155 Joined: Fri Feb 16, 2007 1:29 pm
Contact:
Post
by Tazz » Thu Mar 05, 2009 1:13 pm
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
$oldier Of Ra
Lieutenant Colonel
Posts: 404 Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:
Post
by $oldier Of Ra » Thu Mar 05, 2009 3:41 pm
That's called basic maths Tazz
Besides, the engine will do just that if you add "+ ( 0 0 40 )" after the origin you specified.
HeavenBound
Colour Sergeant
Posts: 85 Joined: Thu Sep 11, 2008 12:55 am
Post
by HeavenBound » Thu Mar 05, 2009 9:42 pm
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.
HeavenBound
I'm new at this
$oldier Of Ra
Lieutenant Colonel
Posts: 404 Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:
Post
by $oldier Of Ra » Fri Mar 06, 2009 8:22 pm
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.
HeavenBound
Colour Sergeant
Posts: 85 Joined: Thu Sep 11, 2008 12:55 am
Post
by HeavenBound » Fri Mar 06, 2009 8:36 pm
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.
HeavenBound
I'm new at this
$oldier Of Ra
Lieutenant Colonel
Posts: 404 Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:
Post
by $oldier Of Ra » Sat Mar 07, 2009 9:33 am
Oh, an SH/BT user... That's the one of the reason why I never mod on those games. Getting coords is annoying work.
Aprop
Major
Posts: 291 Joined: Mon Nov 17, 2008 3:40 pm
Post
by Aprop » Sat Mar 07, 2009 9:47 am
$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....
$oldier Of Ra
Lieutenant Colonel
Posts: 404 Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:
Post
by $oldier Of Ra » Sat Mar 07, 2009 3:09 pm
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....
HeavenBound
Colour Sergeant
Posts: 85 Joined: Thu Sep 11, 2008 12:55 am
Post
by HeavenBound » Sat Mar 07, 2009 3:40 pm
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!! =(
HeavenBound
I'm new at this
Tazz
Second Lieutenant
Posts: 155 Joined: Fri Feb 16, 2007 1:29 pm
Contact:
Post
by Tazz » Sat Mar 07, 2009 3:51 pm
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
HeavenBound
Colour Sergeant
Posts: 85 Joined: Thu Sep 11, 2008 12:55 am
Post
by HeavenBound » Sat Mar 07, 2009 6:32 pm
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.
HeavenBound
I'm new at this
$oldier Of Ra
Lieutenant Colonel
Posts: 404 Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:
Post
by $oldier Of Ra » Sat Mar 07, 2009 8:57 pm
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.