50mm AT GUN brush/model _ROX, JV, HELP???

Post your scripting questions / solutions here

Moderator: Moderators

jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

local.shell is defined here:
local.shell = spawn projectile

Here's a renewed example:

Code: Select all

at50fire:
  local.shell = spawn projectile
  local.shell.origin = $shell.origin // NEW ! :)
  local.shell addvelocity ($at50.forwardvector * 128)
  local.shell dlight 0.8 0.6 0.5 // emit light
  local.shell dmlife 2 // don't fly for more than 2 secs
  local.shell explodeontouch
  local.shell explosionmodel "emitters/mortar_dirt.tik"
  local.shell hitdamage 10000 // a lot
  local.shell impactmarkshader "blastmark"
  local.shell meansofdeath explosion
  local.shell smashthroughglass 0
end 
Image
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

OK......progress..........added this line at the very top: local.shell = spawn models/projectiles/bazookashell.tik

and produced this:

Image

now, what do we do to get the bastard pointing level and moving??? That dark blob to the left is the gun barrel. So, now we have a switch moving that triggers are tankfire sound and produces a bazooka shell that hangs in space pointing down and trailing smoke...
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

hmm did you try the addvelocity?
Image
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

You know, I commented that out to try the 'angle' and 'speed' which was done awhile ago before I got the spawn to appear. But now I'm home and left that test map at work...ugh. I'll try it first thing and see if it matters. How about the angle though??? What's the best way to rotate the axis?
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

it'll depend on how u imported it and in which view
you could try

level.shell.angles = level.turret.angles //this will need you to define the turret
level.a2 = (level.shell.angles[0] + 180 level.shell.angles[1] + 180 level.shell.angles[2] + 180)
// will rotate everything around x y z 180 degrees (0=x;1=y;2=z)
level.shell.angles = level.a2

//that'll work but the angles will need setting :D
hope this helps, prob not cos it's all foreign 2 me :-/
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

the good thing right now is that the gun does not rotate at all. what I hoped to do later was to make a right and left lever that would move the gun about 2 or 3 degrees each time you toggle the lever. I'd have a yaw limit of about 8-10 degrees each way...but that's later. Right now I just want the projectile to fly away at the 180 degree angle the gun faces.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Tiny gun

Post by tltrude »

Here is a thought:

Just spawn (or put in) a tiny scaled down gun model and bind the script_object gun over it. Then you can use all the model commands to make it shoot--a tank turret would work.
Tom Trude,

Image
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

NOW THAT IS A GREAT IDEA! I'll give it a go....would be really cool IF the p_88flak would work like that, all the same characteristics and all. I'll be back shortly with an answer! Of course, that assumes that I can set it up right.

OK.........I suck. Put in a flak88 model (damn cute at .1 scale) and the 88 will work, but my 'binding' doesn't. Any clues as to what scripting or key/values I need to use. I tried a couple basic forms to bind and they don't take. I'm in real bad shape for scripting language.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

glue

Post by tltrude »

Well, there is the command "glue" and that might work. Normally, bind works for me, but I never tried to bind a script_object to a model.

$myscriptobject bind $mymodel

$myscriptobject glue $mymodel

Or maybe the other way around:

$mymodel bind $myscriptobject

$mymodel glue $myscriptobject
Tom Trude,

Image
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

Ok, the 'glue' worked. Now I have to fix the barrel of my AT gun... it flips around in the opposite direction of the 88turret regardless of angles. I'm sure it has to do with where the 88 sits...some kind of entity conflict I guess.

BUT.... how do I get a damn projectile to come out of the 88? I'm using the 'usable flak88 turret' tik that was done up long ago by someone around here. The p_flak88 doesn't work with scaling...it always pops in at full size. Sad, because it actually fires a shell that explodes. Trying to figure out how to adjust the tik files.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

invisible

Post by tltrude »

Can you make the model invisible in the tik somehow? I have seen that problem with models before, and most people will tell you to turn it into a script model. But, you can't do that because the model commands will stop working.
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

rendereffects "+dontdraw"
Image
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

Ok, thanks JV, I'll try that. Need to find the time today.
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

Post by Desert Eagle »

You could try using The projectile generators in spearhead. I used them in my Come In Fighting Tow Map. You could use the model of the flak 88 and scale it down so it is not seen by the players, and place it near the end of the barrel of your gun. You would get sound, flash, smoke and even a projectile.
Desert-Eagle
....The Eagle Has Landed...
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

PROGRESS.... Ok, haven't got the shell spawn working so well, but I do have the gun triggering a randomly spawned explosion down range. I grouped a few script_origins and now you can 'fire' the gun and get an explosion at the other end.

NOW, how to get a smoke/muzzle flash at the end of the barrel??? IDEAS? Which .tik can be used or fx_ to get it? Oh well, hopefully can make a sample guide and map later.
Post Reply