Floating Weapons - Is it Possible? Created 7 years ago2017-01-07 22:50:08 UTC by twitch1 twitch1

Created 7 years ago2017-01-07 22:50:08 UTC by twitch1 twitch1

Posted 7 years ago2017-01-07 22:50:08 UTC Post #332982
Is there a way to make weapon entities float or even spin?
Posted 7 years ago2017-01-07 23:17:12 UTC Post #332983
NVM, I think I figured it out. func_wall_toggle and a trigger. Wish there was an easier way though.

But can you make a model spin/rotate constant?
Posted 7 years ago2017-01-08 03:13:10 UTC Post #332984
Spawn it on an invisible func_rotating?
Tetsu0 Tetsu0Positive Chaos
Posted 7 years ago2017-01-08 08:10:33 UTC Post #332985
Without mods its quite a struggle but if its a mod it could easily be animated or even coded
Posted 7 years ago2017-01-08 15:36:43 UTC Post #332987
Thx guys. Yeah, not a mod, just vanilla HLDM. There are amxmodx server plugins that do what I need but I can't pack that up with a map release.
Posted 7 years ago2017-01-08 18:57:53 UTC Post #332988
you can make a floating weapon with a trigger_push ;)
Posted 7 years ago2017-01-09 00:24:26 UTC Post #332994
W-models have a special flag for rotation inside model itself, but I don't remember if it works for GoldSource properly, or only for Xash3D. I can check this later, if needed. But, anyways, it's a model's property, not an entity's setting. So it will work for custom models only.
Posted 7 years ago2017-01-09 14:51:58 UTC Post #332999
i guess entities of weapons are coded for not to use model sequence from w_ models. but you can include rotating versions of w_ models, you can use them with another entity.

for example make an animated rotating "w_9mmar" model, and name it "9mmar_rotating" and use it with a "cycler" entity. and add a trigger for equip.

http://twhl.info/tutorial.php?id=64

i found this, i guess this is about adding a model key that can be picked from the ground.

but sadly i dont have any idea about posibility of deactivating model entity after equipping.
Posted 7 years ago2017-01-10 15:27:41 UTC Post #333016
@hfc : trigger_relay (KillTarget) or env_render
Posted 7 years ago2017-01-11 09:05:20 UTC Post #333020
I remember some key values that do exactly this thing. It at least works in CS.

gravity: 0.0000000001
avelocity: 0 360 0

Set these with SmartEdit off.
Posted 7 years ago2017-01-11 14:00:29 UTC Post #333025
holy shit, vluzacn himself with his secret knowledge. seems like hl has no boundries
Posted 7 years ago2017-01-11 14:58:33 UTC Post #333027
wait what the hell vluzacn is a member here
Instant Mix Instant MixTitle commitment issues
Posted 7 years ago2017-01-11 15:59:45 UTC Post #333029
To add to vluzacn's suggestion, this is effectively a list of all entity keyvalues that you can set manually: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/util.cpp#L200

This function handles them: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/util.cpp#L1986

The types under the "default:" label are not supported. So if it's a string, a number or a position/angle, you can set it.

Be careful though, not all keyvalues will be handled properly and some may be overridden by entities.
Posted 7 years ago2017-01-11 23:55:12 UTC Post #333034
Vulcan's idea worked but map crashes when you try and pick up the weapon. Looks awesome... wish it worked
Posted 7 years ago2017-01-12 08:22:46 UTC Post #333037
many years ago i found something similar by vluzacn, a "controller" key with some weird big integer value to use on cycler_sprites for models of characters, like the monster_hev_dead or something to make the torso and head centered because by default its all twisted to one side
Posted 7 years ago2017-01-12 14:20:19 UTC Post #333042
@twitch1

i guess weapons cant picked when midair. they should hit ground for this.

i encountered several times,

same thing happens when a monster drops his gun to inside of a wall, the guns slowly falls and rotates in solid wall, if gun hits the ground after falling in that solid brush, then it is posible to pick up.

if i recall correct this thing also happens when monster drops his gun into his collision hull. you have to wait until dying sequence is over to get his weapon.
Posted 7 years ago2017-01-12 19:59:58 UTC Post #333046
@Bruce:
The controller keyvalue is actually a list of 4 numbers, and controls the bone controllers of the entity's model. It's stored as an array of 4 bytes, which are unsigned 8 bit integers: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/engine/progdefs.h#L120

If you want to set such a value, you'll need to convert the decimal value to the unsigned integer representation first, then offset those so it's in the right position in the array. You'll probably have to compute and set the values for the other controllers as well, unless they're unused for the model.

@hfc:
That's because the Touch method for weapons is only set once it falls on the ground: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/weapons.cpp#L486
Posted 7 years ago2017-01-14 11:05:13 UTC Post #333056
Would there be some way to have it touch the ground then be teleported/pushed/etc. to where it needs to go? Or would that just deactivate it again?
Jessie JessieTrans Rights <3
You must be logged in to post a response.