script_mover, model2 problems


(chavo_one) #1

I’ve been trying to get a moving tank working, and good grief is it a MAJOR headache. There are things about this that are not even remotely touched upon in the reference guide…like the fact that your clip brush script_mover must be rotated 90 degrees from the direction you want it to move in originally. I thought it weird that in goldrush the truck and tank were rotated, but it turns out they have to be. :???:

Anyway, on to my remaining issues. The tank moves fine, but for the life of me I can’t get the clip brush to be at the same height as the model2. Here’s a screenshot of the problem:

I’ve verified that the clip brush script mover is flush with the ground, but the model2 is not. It spawns almost halfway in the ground. Anybody have a clue as to what I’ve botched here?

The other issue I’m having is best described by this screenshot:

Here the mounted gun is rotated 90 from the direction it should be pointed, but is still firing out front in the correct direction. I’m off to grab some tylenol, so if you can help me out I would be very appreciative!


(Mlehliw) #2

Hmm that makes me even more grateful I decided to stay away from tanks. And, sorry, but that last shot is fricken hilarious.


(hummer) #3

Heh… asked Digibob about this one:

<Hummer|Cartogra> Anyway, how is he building the wrong way around?
<@digibob> he said he made it 90 degrees rotated i thought o_O
<@digibob> + his origin brush looks like it’s prolly screwed…
<Hummer|Cartogra> I think he’s rotating the brushwork to face the way the tank will end up driving In the editor…
<Hummer|Cartogra> Should he just rotate the mover with scripting instead?
<@digibob> yes
<Hummer|Cartogra> So, you should build clips around the model, just as the model is shown in the editor… then rotate the clips via scripting…
<@digibob> indeed


(chavo_one) #4

Thanks for sharing hummer! :smiley: I’ll try to provide some more info. Hopefully, with this something can tell me exactly what is wrong.

Screenshot from radiant showing the tank clip brush in place (not rotated 90 degrees in this example.) You can also see the first spline point as it is also highlighted. The script_mover’s origin brush is at the same height as the spline point. The TOI and trigger_multiple origins are at the turret_tag.

This screenshot shows how the clip brush has been rotated in game. I am actually standing on the back end of the tank’s clip brush. You can also see how the tank is sunk into the ground.

Here’s the script_mover entity info from the bsp:

{
"description" "Churchill Mk VII"
"classname" "script_mover"
"targetname" "tank"
"scriptname" "tank"
"health" "1200"
"tagent" "tank_turret"
"gun" "browning"
"spawnflags" "190"
"model2" "models/mapobjects/tanks_sd/churchhill_oasis.md3"
"origin" "-3966 -1022 -168"
"model" "*3"
}

Here’s the spawn function for the script_mover:

	spawn
	{
		wait 50
		trigger self sound_idle

		accum 1 bitset 5
		trigger self tracks_stop

		//Reset the tank into correct position
		followspline 0 spln0 10000 wait
		followspline 1 spln0 10000 wait

		trigger self run_incpos
	}

Any new ideas? I’ve constructed this setup exactly as described in Hummer’s conversation with Digibob.


(hummer) #5

Drop a misc_model or misc_gamemodel (do not rotate) of the tank next to the clipping in the editor… I want to see that the clipping and model are facing the same direction.


(diaper eater) #6

make sure the origin brush for the clip brushes matches the origin of the tank, so set a tank model in there, then find its origin, cube with lines coming out of center perp to cube frame, and make the origin brush right where that is, which is usually sunk into the ground i think with the tanks, only messed with it once


(chavo_one) #7

:weird: It’s funny how someone can explain something to you that is perfectly clear, yet for some reason you are completely unable to understand it. Well that was me.

The lightbulb went off after reading hummer and diaper eater’s comments. Those were exactly the issues that I had messed up. Saving you all from my explaining why I did the things I did, I’ll just summarize with the things I learned.

  1. Insert the model you want to attach to your clip brush script mover into the map. Do not rotate!
  2. Build your clip brushes around this model. Do not rotate!
  3. Create an origin brush for the clip brush script mover at the origin of the model.
  4. Delete the model.

Following this fairly obvious (now) plan will save you all much grief.

I am still having the problem with the attached Browning gun not firing correctly. If you look at the pic in my first post, you’ll also notice that my player icon is not with the tank. The tank continues to move, while my player icon stays at the point where I got on the tank. Does anyone have any ideas about what’s wrong with this? What entities does the gun need to function correctly?

Thanks again to you guys that helped me see the light! :cool:


(ydnar) #8

The mounted browning gun doesn’t work in 3rd person view. It looks fine to other players though… :slight_smile:

y


(chavo_one) #9

Good point ydnar! :fiesta:

Unfortunately, mine doesn’t work in 1st person either. :banghead:


(hummer) #10

Wunderbar!

Well, sorta… at least the model moves correctly :smiley:


(chavo_one) #11

Finally figured out why the gun wouldn’t work. It’s because I am using the oasis churchill, and the needed files weren’t provided with the SDK in order to use it as a tank objective. So, with my limited knowledge of md3s, I have kludged my tank together, and everything works.

If anyone out there is curious, you are missing the following files for the oasis churchill:

churchhill_oasis.shadow
churchhill_oasis_broken.shadow
churchhill_turret_oasis.tag

That last file was the kicker. Without it, the player wouldn’t follow the tank when in the gun, and of course the gun wouldn’t fire correctly.

The last thing bugging me is the fact that the game attaches the snow mg42nest to my turret. Does anyone know how I can get the mg42nest that was attached to the jagdpanther in goldrush to attach to my churchill?
It looks dumb with a silver/grey gun nest sitting on a desert colored turret.


(Loffy) #12

Hi!
Im curious. How is it going? With your tank-moving-mapping? Does it move the way you want?

Hm, have you tried “remapshader <target> <replacement>” at the beginning of your script, to switch the appearance? I dont know if it works.
I mean, there is this line in the beginning of the goldrush script:
remapshader “models/mapobjects/tanks_sd/mg42turret” “models/mapobjects/tanks_sd/mg42turret_2”. Im no scripiting guru but it seems as if one turrent is switched to another here.

// Loffy


(chavo_one) #13

Viola! Thank you! I didn’t notice the remapshader at the beginning of the goldrush script, but it does exactly what you thought it would.

As far as getting the tank to move, all of that works properly. I haven’t scripted in certain events into the tank’s run functions, because I have a lot of brushwork yet to finish. This map is turning out to be a monster. About the size of fueldump, but with lots of buildings everywhere.

When I get done with all the brushwork, I plan on getting deep into the actual scripting details of the movement, like learning what roll, dampin, and dampout actually do.


(Ricm!!!) #14

can u post your map and script please? :???:


(chavo_one) #15

If I posted my map and script it would give you no more information than the goldrush source does. If you are confused by the example in goldrush, then my map won’t help you.

I’ve said before, that once I finish my map, I will create a tutorial map for anyone that wants it. But that’s still a couple of months off. :frowning:


(Ricm!!!) #16

i know, but i thing your script is more clean, and i cant almost move in goldrush, my pc its oldie :angry:

70 sec load time aprox on goldrush.

good looking map, and 125fps!!!

look at my graphics :banghead:


(damocles) #17

If anyone out there is curious, you are missing the following files for the oasis churchill:

churchhill_oasis.shadow
churchhill_oasis_broken.shadow
churchhill_turret_oasis.tag

Any chance you will post these up somewhere chavo? Might be useful for others who don’t know how to make the tags.


(chavo_one) #18

I just renamed the tag file from the snow churchill and it worked! :uhoh:

Although, now that sock released the tag exporter (Thanks sock!), I’m sure it could be done the better way


(Doc_A) #19

Can anyone point me to the “tag exporter” mentioned above that was
released by sock?

Thanks.


(chavo_one) #20

But of course!

http://www.splashdamage.com/forums/viewtopic.php?t=3003&start=30#35841