Aimable panzerfaust


(Miki) #1

I know how to add a PF in a map
I know how to aim a PF in a map
I know how to fire a PF in a map, by letting ppl push a button

but i don’t know how I can let PPL aim it.
What are ways to do this?
Pressing buttons? Making it like an MG42?

What i’m trying to make is a MG42 that shoots PF, just for a funmap :slight_smile:

Thanks in advantage :slight_smile:

Miklas


(isbowhten) #2

i dont think this is possible but you can at least put func_invisible_user entites around the panzerfaust and then you just look in the direction you wanna shoot and then it shoots in the direction you look.

but it is not possible in my opinion to make it like a mg42.

you will have to press buttons, or you shoot at “glass” if you wanna shoot (pain event, but that costs ammo etc)


(Miki) #3

isn’t it possible with something like

<-- ARROW TEXTURE ARROW TEXTURE -->
PANZER

and that if you push the left arrow, the panzer rotates with 5 degrees?
(same with up and down arrow)


(-SSF-Sage) #4

It is not possible. What you CAN do is to have several presetted points that you “select” with buttons. Like press button on left, it moves to the next presetted targetpoint. There are some prefabs on the forum and many threads about it already. Search with controllable cannon or such.


(kamikazee) #5

[QUOTE=Miki;186858]isn’t it possible with something like

<-- ARROW TEXTURE ARROW TEXTURE -->
PANZER

and that if you push the left arrow, the panzer rotates with 5 degrees?
(same with up and down arrow)[/QUOTE]That’s how it may look, but still not how it may work.

I think it needs quite some scripting and a whole bunch of entities. The basic premise is that you move the target_null around so that the panzerfaust entity will aim at a different spot. The problem is that entities can only be moved to discrete spots, like other target_null or path_corner2 entities.


(isbowhten) #6

wha you can do is attach a info_null to a tag very far away from your cannon…
then you rotate the cannojn, the tag rotates, the info_null rotates…
see? but the panzerfaust will only fly til the info_null so i would suggest you to put itr faaaaar away to reach all distances.

rotation by buttons is do-able ofc.
i suggest a timer and setrotation (cause thjis moves it relativels to its position, faceangles does only rotate to a certain diretcion)


(MrLego) #7

As far as I know you can’t actually aim a panzer in a map but you can fake it fairly easily.

You can insert a static model of a panzerfaust in your model for the visual and then use a func_invisible_user that triggers a shooter_rocket entity.

The angle property of the shooter_rocket determines which way the shot will go and the angle property of the panzerfaust model to make things look correct.

You could probably target the shooter rocket with an info_null as well.

One thing that you cannot do is make the ejected shell of the shooter_rocket look correct - it will always be ejected at zero degrees - this is because there is no angle being passed to the ejected shell in code (the angle for a player-fired panzer is passed to the shell from the player entity itself)

I have done this in a few maps before and it’s fairly straightforward.

The MLB maps also use the shooter_rocket entities - if you noclip yourself into the secret control rooms you can fire them off.


(Tyrlop) #8

can info_notnull be attached to a script mover or something?


(isbowhten) #9

yes…
can be attached to a tag which is part of a model whose value is in the script_movers model2 key.


(Tyrlop) #10

well then i think its actually quite easy in theory. like two switches/triggers you pull x and y. u know.


(Zer0Cool) #11

also easy in praxis ^^ but once you want such a gun which you cant just rotate but also move by itself it becomes complicated ^^


(isbowhten) #12

hehe lol…
yes he made a roboter, but i have to say :stuck_out_tongue:
with an invention by me.