Bind question

Post your scripting questions / solutions here

Moderator: Moderators

strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Bind question

Post by strafer »

I have a tank binded to a parachute and whenever I have the parachute move down from the sky, the tank spins around in circles like crazy. The parachute and tank move to where I want though. Anyone know how I can fix this?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Script_model

Post by tltrude »

Is the tank a script_model (classname)?
Tom Trude,

Image
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

No.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

tank

Post by tltrude »

Try changing its classname to "script_model". You can always hide/remove it when it gets to the ground and spawn the real tank at that spot.
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Spawning things will do that too especially tanks . Try not to use the tanks in the static directory there are some in the vehicles directory that you can use and I think the couple in the animate directory are made for that .
Image
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

bdbodger wrote:Spawning things will do that too especially tanks . Try not to use the tanks in the static directory there are some in the vehicles directory that you can use and I think the couple in the animate directory are made for that .
I'm using the tigertank.tik file from the vehicles folder and there isn't one that I could find in the animate folder. I could only find a kingtiger tank and an opel truck.
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

I tested out cobra's mg42 script for the tank and it works fine, but the binding problem happens to it too. When the tank is driving, the mg42 spins in it's spawning point.
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Would making the turret point to a designated spot in the map stop it spinning?
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

G'day there, I was thinking some more about your problem so looked into the files within the sdk.

setAimTarget: this sets an entity for the turret to aim at. It will physically point at its aim target. This will get over ridden when the turret has a user (AI or player)

clearAimTarget: This clears the aim target set by the use of the setAimTarget command.

These commands can be used from script or editor.
Grassy
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Yeh the MG42 was for a static tank not a moving tank Strafer, the best i got on a moving one was attaching it to its turret altho it didnt like me trying to adjust its position to where i wanted it using an offset so it was spawning inside the turret (not where i wanted it) so i didnt use it

Ps what they mean is use a static tank for the parachute drop and upon it landing remove it and respawn one in its place that you intend to have driving around and thread to its driving script

eg - heres how i done the allied GMC truck in Omaha Assault...

(this happens halfway thru a c47s flight and is hidden until release from it)

local.gmc1 unglue local.g_spot1
wait 1
local.ori = spawn script_origin
local.ori.origin = local.gmc1.origin + ( -40 0 50 )
local.ori bind local.gmc1
local.chute = spawn script_model
local.chute model "static/parachute.tik"
local.chute scale 2.5
local.chute.origin = local.ori.origin
local.chute glue local.ori
local.gmc1 show
local.gmc1 solid
local.gmc1 speed 150
local.gmc1 movedown 2300
local.gmc1 waitmove

spawn models/vehicles/gmctruck.tik "targetname" "truck2"
$truck2.origin = local.gmc1.origin
$truck2.angle = 3
$truck2 nodamage
$truck2 solid
local.chute unglue local.ori
local.gmc1 remove
local.chute movedown 130
local.chute waitmove
local.chute remove

//now have your nodes etc here and its drive commands

Voila!!

Image
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Awsome cobra, thanks.

Do you know why my if statement isn't working? I posted it above. It is supposed to do something if a player hits the use key.
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Be more helpful if you posted the script
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

lol oops. I was thinking I posted it in this one, but I put it in another one. :oops:

Code: Select all

// SNOWY PARK 
// ARCHITECTURE: NED 
// SCRIPTING: NED 

main: 

// set scoreboard messages 
setcvar "g_obj_alliedtext1" "Snowy Park" 
setcvar "g_obj_alliedtext2" "" 
setcvar "g_obj_alliedtext3" "" 
setcvar "g_obj_axistext1" "" 
setcvar "g_obj_axistext2" "" 
setcvar "g_obj_axistext3" "" 

setcvar "g_scoreboardpic" "mohdm5" 

   // call additional stuff for playing this map round based is needed 
   if(level.roundbased) 
      thread roundbasedthread 

   level waitTill prespawn 

   //*** Precache Dm Stuff 
   exec global/DMprecache.scr 

   level.script = maps/dm/mohdm5.scr 
   exec global/ambient.scr mohdm5 

   level waittill spawn 

   thread allied 


spawn script_model "targetname" "rad1" 
$rad1 model models/animate/alarmswitch.tik 
$rad1.origin = ( 4692 -4015 172 ) 
$rad1.angle = 90 
$rad1 triggerable 
$rad1 solid 


snow: 
   wait 1 

   level.rain_speed = "32" 
   level.rain_speed_vary = "16" 
   level.rain_length = "2" 
   level.rain_width = "1" 
   level.rain_density = ".2" 
   level.rain_slant = "250" 
   level.rain_min_dist = "1800" 
   //level.rain_min_dist = "512" 
   level.rain_numshaders = 12 
   level.rain_shader = "textures/snow0" 


end 

allied: 

$rad1 waittill trigger 


   if (local.player.dmteam != allies) 
      { 
         if (local.player.useheld == 1) 
         { 
         local.player = parm.other 
          
         local.rad1 anim move 
         local.rad1 playsound lighthouse_lever 
         iprintln "it works!" 
         } 
          
      } 
   else 
      { 
      iprintln "You are not on the Allies Side!" 
      } 

end 

//----------------------------------------------------------------------------- 

roundbasedthread: 

   // Can specify different scoreboard messages for round based games here. 

   level waitTill prespawn 

   level waittill spawn 

   // set the parameters for this round based match 
   level.dmrespawning = 0 // 1 or 0 
   level.dmroundlimit = 5 // round time limit in minutes 
   level.clockside = kills // set to axis, allies, kills, or draw 

   level waittill roundstart 

end 
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Should it not be..

$rad1 anim move
$rad1 playsound lighthouse_lever
iprintln "it works!"

the capital T works?
(level waitTill prespawn)
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Cobra {sfx} wrote:Should it not be..

$rad1 anim move
$rad1 playsound lighthouse_lever
iprintln "it works!"

the capital T works?
(level waitTill prespawn)
I've tried $rad1 anim move. It also didn't work.

I guess the T works...I never noticed it being capitalized...
Post Reply