Please or Register to create posts and topics.

Launch console commands?

Page 1 of 3Next

Hi!

I'm fairly new to Hammer modding.

I'm trying to create a custom map for Portal 2 in Hammer.

Now, one of the functions in the map will (if I can manage) be a rocket launcher (i.e. a player-wielded rocket launcher).

I've managed to create a paintgun using game_ui and info_paint_sprayer etc.
I would like to replace that info_paint_sprayer with something that fires rockets, but there seems to be no such entity in the SDK, but I know that the game supports rockets since the prop_rocket_tripwire does fire rockets, and more to the point - fire_rocket_projectile works as a console command.

Now, I figure that the easiest route would be to somehow trigger this fire_rocket_projectile command. Is this possible to to from within Hammer? For example by binding it to an output in game_ui.

If that's not possible, does anyone have any idea on how to create a rocket launcher in any other way? For example by lifting the rocket script from prop_rocket_tripwire. But I have absolutely no idea on how to do that.

Thanks for any help!

The easy way would be to use a point_servercommand or point_clientcommand. The good way would be to use an env_entity_maker set to launch the templateat a certain speed in a certain direction with a rocket_turret_projectile (which shows up broken in Hammer but actually does work).

Falsi sumus crusto!

Thanks for the reply!

I'll try the good way first, then. I've read up on env_entity_maker and I think I understand how it works. However, where do I find the rocket_turret_projectile? It's not available as an entity in Hammer.

Do I need to import it from somewhere? Or am I misunderstanding something?

FelixGriffin wrote:
The easy way would be to use a point_servercommand or point_clientcommand. The good way would be to use an env_entity_maker set to launch the templateat a certain speed in a certain direction with a rocket_turret_projectile (which shows up broken in Hammer but actually does work).

The entity will not show as a valid entity, just type it in and press enter a few times. It won't have any properties most likely, but give it a name and put it in a point_template, and that point template in the entity maker.

My YouTube Channel: https://www.youtube.com/user/Camben24
Aperture Science: We do our science asbestos we can!

It was left out of the FGD (Hammer's entity list), but still works. Just type it in the classname box.

Falsi sumus crusto!

Thanks for the replies!

Just creating an entity rocket_turret_projectile did indeed work! If I place it in the air it just hangs there :)

However, I am having trouble pointing the point_template to it.
In my rocket_turret_projectile I created a property "Name" and named it "rocket_projectile".

However, when I try to point Template 1 in my point_template to it, it doesn't work. I can't use the dropper-thingy and simply click on "rocket_projectile"; Template 1 just remains empty. I can, however, manually write "rocket_projectile" but the text is red, indicating that it doesn't exist.

Also, I get an error message when trying the map, "CreateInstance called on a point_template that has no templates: rockettemplate1" where rockettemplate1 is my point_template.

I trigger it from an env_entity_maker.

Any ideas?

Thanks again!

Never mind! I got it to work!

I didn't realize that the name property was supposed to be "targetname", not "Name". Smartedit fooled me :)

Thank you for your help!

One final question: I don't get any sound while the rocket is moving, and console gives me an error message saying that the sound files "weaponsrocketrocket_fly_loop1.wav" and "weaponsrocketrocket_fire1.wav" is missing. However, the client command fire_rocket_projectile has these sounds. Do I need to manually include these sounds in my map somehow?

bawng wrote:
One final question: I don't get any sound while the rocket is moving, and console gives me an error message saying that the sound files "weaponsrocketrocket_fly_loop1.wav" and "weaponsrocketrocket_fire1.wav" is missing. However, the client command fire_rocket_projectile has these sounds. Do I need to manually include these sounds in my map somehow?

Yes, if the entity wasn't finally included into the game, maybe those sounds weren't either... Maybe you can get them from HL2 or any other game (I don't know where that entity was used), then pack them with pakrat: place them in the path you posted inside the sounds folder, then use pakrat to add them manually... the game should locate the sounds from inside the .bsp.

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

The files should be in both HL2 and Portal 1, so you can get them from the SDK base. Otherwise they're in Skotty's Fixed Rocket Turret instance.

Falsi sumus crusto!

Thanks, I'll try this!

Page 1 of 3Next