mounted_gun on script mover is displayed but not usable...


(Serge) #1

Hello.

I am in a trouble with scipt_mover’s mounted_gun.
I made a vehicle out of a script_mover wich works fine and is correctly triggered and so on…
This script_mover have a mounted gun attached to it but when i am near this one, no icon appear and the use button wont work. What is wrong ?


(Chruker) #2

I think the model needs to have a tag called tag_player. churchhill_turret.md3 does


(Siemnov) #3

I’m bugging on that one too right now. It does appear at the right spot, but is not useable. Do I need a func_invisilble_user or something?
And I am using churchill_turret.md3 now.
All I want is a broken non-moving tank with an mg42 on top.
<edit: churchill_turret_oasis.md3 does exactly the same, started using that one>

Does the MG require triggers in the script? Is it spawning as nonuseable? Or do I need a trigger_objective_info around my tank even when it’s nog moving? I don’t get it :???:

Offcourse, when the tank is broken, it’s not possible to mount the mg. Maybe it has something to do with that?


(DaRkFiRe) #4

Make sure that in your script_mover entity, you have the key “tagent” and value “tank_turret”, or whatever the targetname of your tank turret is.


(Siemnov) #5

Well, since it does appear right, I would allready need to have that set. No, that’s not the problem.


(DaRkFiRe) #6

If your spawning the tank dead, then no, you wouldn’t be able to mount the gun.


(Siemnov) #7

So, what do I need in the script to make it right? How can I make it spawn in repaired status?

tank
{
	spawn
	{
		wait 200
		alertentity tank (this or..., found it in goldrush script)
	}
}

Where tank is my script_mover’s scriptname.
Something like this?

Help is greatly appreciated. The idea was proposed by my fellow clanmembers to make the map more balanced.


(Serge) #8

I think splashdamage should answer once and for all to this one. For the moemnt all we can do is wait and prey that they will answer one of this days.

Mounted guns were supoosed to be an important feature of the map Falcon. I have been forced to rethink the entire project and the map is not what it could have been …


(Siemnov) #9

Is there really noone who knows? I thought a mounted gun on script_mover was a normal technique, not so much harder than doors.
I’m sure it’s just one bit of detail i’m missing. But what is it? Don’t any of the SD guys know something? Chavo, Drakir? Anyone? Does a script_mover spawn damaged or something?


(Serge) #10

If the solution is already given somewhere else in this site could you please be enough kind to point at the post who clearly explain the tricks and tips for doing usable mounted guns without necessary using the game tank model.

Keeping this knowledge for you wont make an intelligent person of you. Intelligents persons share their knowledge because they dont have anything to prove and nobody to fool.


(chavo_one) #11

Serge, you were given an answer to your question 2 weeks ago. Look at the first reply to this thread. If you are making a script_mover from something other than the churchill used in fueldump or the jagdpanther used in goldrush, then your model has to have a tag called tag_player. That is what the game uses to attach the player model to the mounted gun. If you are trying to attach a mounted gun to a brushwork script_mover, then you are hopelessly lost.

Outside of that, maybe you could post your entity information. Just saying something doesn’t work won’t help anyone understand what your problem is.

Also, read this thread from start to finish:
http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=2703


(Serge) #12

Thanks for reply.

I would just add that my first attempt was to use the tank model with all the stuff correctly set but it did never allow me to use the gun.

If it had worked, i would have placed the model with its tag_player in such a manner it would be invisible (modelscale very low for exemple).

But the fact is that whenever i use the requested model or a brushwork the munted gun appear at the correct place and move as intended with the vehicle but is still unusable.

Once again thanks, but it doesn’t work… And the map is already out, without mounted guns


(Siemnov) #13

Ok, well it still won’t work for me. I took a look at the tag program and made tagfiles for all my models in the tanks_sd folder. Maybe it’s just that I’m using the broken tank body and that the mg won’t work, because the script_mover’s model is a broken tank, not repaired? (doesn’t seem logical)
And since the mg does appear right, the model should have the tag allready right?

Here’s my entity data:

// entity 212
{
"angle" "333"
"classname" "misc_gamemodel"
"origin" "800 1240 1120"
"model" "models/mapobjects/tanks_sd/churchhill_turret_oasis.md3"
"targetname" "tankturret"
}
// entity 213
{
"model2" "models/mapobjects/tanks_sd/churchhill_broken_oasis.md3"
"angle" "260"
"targetname" "tank"
"scriptname" "tank"
"type" "browning"
"tagent" "tankturret"
"spawnflags" "130"
"classname" "script_mover"
// brush 0
{
( 793 1249 1096 ) ( 791 1233 1096 ) ( 791 1233 1064 ) common/origin 37 16 0 0.495117 0.500000 0 15 0
( 809 1247 1096 ) ( 793 1249 1096 ) ( 793 1249 1064 ) common/origin 46 16 0 0.495178 0.500000 0 15 0
( 807 1231 1096 ) ( 809 1247 1096 ) ( 809 1247 1064 ) common/origin 41 16 0 0.495239 0.500000 0 15 0
( 791 1233 1096 ) ( 807 1231 1096 ) ( 807 1231 1064 ) common/origin -13 16 0 0.495117 0.500000 0 15 0
( 791 1233 1080 ) ( 793 1249 1080 ) ( 809 1247 1080 ) common/origin -23 -57 -8 0.499922 0.499991 0 15 0
( 809 1247 1064 ) ( 793 1249 1064 ) ( 791 1233 1064 ) common/origin -23 -57 -8 0.499922 0.499991 0 15 0
} . . . And up to 8 brushes
}

Thanks again for your time and i’m really sorry if i’m being stupid.

I just thought of something. Offcourse my tank is far from a complete moving tank and so I also can’t see it’s name when I point my crosshair over it. So how does it know where the tank is?


(Siemnov) #14

So I have created a tagfile for the tank, my entities are listed above, I have tried using the nonoasis tank and using a repaired tank model, I allready have a trigger_objective_info around my tank (not targetted or targetting) and I have nothing in my script to influence my tank.
Why can’t I mount my MG?! It does appear, what is it that makes an MG mountable with a normal tank?


(Chruker) #15

I’m very confused about this. The first tank I made I could use the gun.

Then I made several others however I wasn’t able to use the gun. Even though everything should be ok.

Now I tried compiling one of those again, and couldn’t still use the gun. The spawnflags were solid, compass, mounted_gun. Then I added explosivedamage, and suddenly I can use the gun.

Hmm. I found a bug I thought. But after removing the explosivedamage spawnflags, and recompiling a couple of times, the gun is still usable.

Does a script_mover really need to have its explosivedamage spawnflag set once to be able to use the gun? That doesn’t make sence, but it seems to.


(Serge) #16

Oh thanks God for this bit of hint. I will try this.

Thanks again man ! Have a good day !


(Siemnov) #17

Well I think I found out about it. For a MG to work, your tank needs a healthkey. Otherwise it always acts like the tank is damaged.
But I want a broken tank with an MG. Is that impossible then?


(Serge) #18

Thanks again to Chruker : it now works perfectly, but the most important, we know why !

I cant believe that SD guys did never mentioned this trick anywhere…

A thousand thanks to Chruker ! And good luck to Sienmov.


(Siemnov) #19

I did get it to work with the health key, but then it’s damageable. Maybe I can constantly repair it using script? What is the scriptevent when damaging entities?
Like this:


tank
{
 spawn
 {
  wait 200
 }
 pain
 {
  alertentity tank
 }
}

(C) #20

I experimented with my own script_mover and a mounted gun.
I created a model (MD3) with some tags, including a tag_player.
The mounted gun appeared without any problems, but a player could not attach to the model (or mounted gun).

My script_mover was created from clip-brushwork (and an origin-brush of course).
It was only after i changed the usual clip texture to the common/clipweap_metal texture that i could attach a player to my script_mover. hop in folks!

I’ve tested this behavior by changing the texture/shader back to the common/clip shader, and no player was able to “use” the script_mover.
Changing it again to common/clipweap_metal, and… it works.