AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   CS:GO – Spawning live bumpmine_projectiles (https://forums.alliedmods.net/showthread.php?t=327441)

Muhlex 09-18-2020 20:19

CS:GO – Spawning live bumpmine_projectiles
 
I am trying to spawn live bumpmines (basically as if a player thew them but without the actual throwing part). While it is easy to create the according entity bumpmine_projectile, it does not behave like bumpmines thrown from weapon_bumpmine at all:
They...
  • will not use the same physics
  • will float slightly off of the ground
  • won't stick to surfaces nor turn to face slopes when put on them
  • simply cannot be used at all (always deactivated)

I have checked the netprops of the entity and switched m_bArmed from 0 to 1. This causes the blue particle effect on them to appear, but does not actually activate them nor does it cause their "armed" sound to play.

Seems like it is either very hard to replicate the way Valve handles them or that I'm missing something obvious. I have tried changing a couple other props to ones that I took from self-thrown, working bumpmines (via GetEntProp) – to no avail. These are the netprops I tested and their respective values.

PHP Code:

m_bArmed1
m_fFlags
0
m_iTeamNum
3
m_vecVelocity
: [-230.033.150.00// This varies and seems to be the velocity just before the game freezes them in place on impact.
m_vecForce: [0.000.000.00]
m_bIsLive0
m_spawnflags
0
m_hThrower
1
m_hOwnerEntity
1
movetype
0
movecollide
0
m_flDamage
5.00
m_DmgRadius
200.00
m_CollisionGroup
13
m_flMaxFallVelocity
0.00
m_nParentBoneIndex
: -1
m_vecParentBonePos
: [0.000.000.00

I'm not even looking for them to behave exactly the same, I would be happy with them being usable at all. Would be awesome if anyone knew how to do it or had another idea.

Shadowysn 10-14-2020 07:02

Re: CS:GO – Spawning live bumpmine_projectiles
 
There are two seperate property types you can use: Netprops and Datamaps.

Datamaps may have a few hidden server values not shared with the client, although some/most others are also save values (netprops) at the same time.

You can dump datamaps in a similar way as you can netprops, by typing into the developer console:
sm_dump_datamaps "Datamaps CSGO.txt"

However, dumping datamaps will also crash or freeze your game.
It's just a side-effect of spawning every single entity into the game in order to get their properties. The datamap dump file will still be generated.

SetEntProp and it's other versions have a second variable you have to put in, either both Prop_Send and Prop_Data.
Use Prop_Send for Netprops.
Use Prop_Data for Datamaps.
Otherwise, you'll get an error in-game if you use the wrong property type.

From what you've said, m_bArmed may be a property that just makes the particles appear to clients, and doesn't pertain to anything else gameplay-wise.
Have you tried m_bIsLive though?

I've barely tinkered with grenade netprops, and the bumpmine seems to be derivative of the base grenade so I don't think I can give actual advice, but as a last-resort you might need to use an offset or signature of the function that makes the bumpmine live.

Muhlex 10-15-2020 13:45

Re: CS:GO – Spawning live bumpmine_projectiles
 
Thanks for the reply! I did roughly get how Netprops and Datamaps work (now I do a little better even, thanks to you).

That said, I seems like I really didn't have a thorough look at the datamaps dump back when I tested this. However I just tried setting different flags based on the ones that working self-thrown bumpmines have, as well as anything that somehow sounds like it could be related to being a condition that activates the mine... to no avail.

m_bIsLive seems to only be used for "regular" grenades and to not affect the bumpmines in any way. I tried setting the obvious properties (netprops and data) previously, with no luck.

I would obviously prefer to not need to keep track of offsets for this feature, but I'm also kind of lost at how to even have a go at that (if nothing else works). I'm also pretty tired of looking through the entity's properties for hours. Will probably give up for now but I'd be happy over any further ideas.


All times are GMT -4. The time now is 00:26.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.