Rules FAQ Members List Search Register Login

 Raised This Month: \$85 Target: \$400 21%

Author Message
Vasto_Lorde
Junior Member
Join Date: Oct 2016
 09-13-2017 , 20:08   [CSGO] Force Velocity on Entity #1 So i have this Entity that i want to move by velocity This is how i create it: Code: ```int ent = CreateEntityByName("prop_dynamic_override"); if(ent != -1 && IsValidEntity(ent)){ float angle[3]; angle[1] = GetRandomInt(1, 360)+0.0; DispatchKeyValue(ent, "model", mGhoul); DispatchKeyValue(ent, "Targetname", "ghoul"); DispatchKeyValue(ent, "Classname", "ghoul"); DispatchKeyValueVector(ent, "Origin", gMonstersGhoulsSpawns[i]); DispatchKeyValueVector(ent, "Angles", angle); ActivateEntity(ent); bool didit = DispatchSpawn(ent); if(didit){ SetEntProp(ent, Prop_Send, "m_nSequence", GHOUL_RUNBACK); SetEntPropString(ent, Prop_Send, "m_iName", "ghoul"); SetEntPropFloat(ent, Prop_Send, "m_flPlaybackRate", 1.0); CreateTimer(0.1, GhoulThink, i); } }``` And the GhoulThink sets the entity velocity like that: Code: ```stock void MoveEntity(int ent, int ent2, float speed){ float velocity[3]; float position[3]; float position2[3]; GetEntPropVector(ent, Prop_Send, "m_vecOrigin", position); GetEntPropVector(ent2, Prop_Send, "m_vecOrigin", position2); float distance; distance=GetEntitiesDistance(ent, ent2); float time = distance / speed; velocity[0] = 100.0;//(position2[0] - position[0]) / time; velocity[1] = 100.0;//(position2[1] - position[1]) / time; velocity[2] = 100.0;//(position2[2] - position[2]) / time; TeleportEntity(ent, NULL_VECTOR, NULL_VECTOR, velocity); //4 types of setting velocity SetEntPropVector(ent, Prop_Data, "m_vecVelocity", velocity); SetEntPropVector(ent, Prop_Data, "m_vecBaseVelocity", velocity); SetEntPropVector(ent, Prop_Data, "m_vecAbsVelocity", velocity); }``` The problem is, wheter i set const velocity or use one of 4 ways to set velocity, the entity doesn't move. There is no console errors, every piece of code is working fine. What am I doing wrong here? PS. changing Prop_Data to Prop_Send only gives me this (Same for all m_vecs): Code: `Exception reported: Property "m_vecAbsVelocity" not found (entity 88/ghoul)`
Rachnus
Senior Member
Join Date: Jun 2016
Location: Funland
 09-13-2017 , 21:33   Re: [CSGO] Force Velocity on Entity #2 try change "prop_dynamic_override" to "prop_physics_override", I don't think you can teleport prop_dynamics by velocity, only by origin. __________________ Github: https://github.com/Rachnus Steam: http://steamcommunity.com/id/rachnus _____________________________________________ _________ Taking private requests
Vasto_Lorde
Junior Member
Join Date: Oct 2016
 09-14-2017 , 04:24   Re: [CSGO] Force Velocity on Entity #3 Still the same :/ I even tried this: https://forums.alliedmods.net/showthread.php?p=1899572 But the console says Code: `ERROR!: Can't create physics object for models/witchermod/ghoul/ghoul.mdl` Last edited by Vasto_Lorde; 09-14-2017 at 05:11.
Rachnus
Senior Member
Join Date: Jun 2016
Location: Funland
 09-14-2017 , 08:59   Re: [CSGO] Force Velocity on Entity #4 Try spawn a prop that works with prop_physics like a dropped C4 and make it invisible, then parent your ghoul prop onto the C4 and teleport your C4 instead of your ghoul, this is what I do here: https://github.com/Rachnus/SuperHero...jgohan.sp#L212 I create a prop_physics with the model "models/weapons/w_ied_dropped.mdl" then parent the env_sprite to it. And the result looks like this: https://www.youtube.com/watch?v=HKy_1t4fp_Q __________________ Github: https://github.com/Rachnus Steam: http://steamcommunity.com/id/rachnus _____________________________________________ _________ Taking private requests
Mitchell
~lick~
Join Date: Mar 2010
Location: noitacoL:
 09-14-2017 , 10:26   Re: [CSGO] Force Velocity on Entity #5 or just spawn it as a prop_physics_override. __________________
Vasto_Lorde
Junior Member
Join Date: Oct 2016
09-17-2017 , 16:37   Re: [CSGO] Force Velocity on Entity
#6

Quote:
 Originally Posted by Rachnus Try spawn a prop that works with prop_physics like a dropped C4 and make it invisible, then parent your ghoul prop onto the C4 and teleport your C4 instead of your ghoul, this is what I do here: https://github.com/Rachnus/SuperHero...jgohan.sp#L212 I create a prop_physics with the model "models/weapons/w_ied_dropped.mdl" then parent the env_sprite to it. And the result looks like this: https://www.youtube.com/watch?v=HKy_1t4fp_Q
Dude you are my master. The movement works fine. But other problems occured:
1. There is a sound of C4 "moving"
2. When they fall from the edge there is a chance they flip over so we can see only feet of ghouls
3. Now my angleEntity function doesnt work, tried it on ghoul and C4 parent(and both), no results. I
Code:
```stock void AngleEntity(int ent, int ent2){
float angle[3];
float position[3];
float position2[3];
GetEntPropVector(ent, Prop_Send, "m_angRotation", angle);
GetEntPropVector(ent, Prop_Send, "m_vecOrigin", position);
GetEntPropVector(ent2, Prop_Send, "m_vecOrigin", position2);

float x = position2[0] - position[0];
float z = position2[1] - position[1];
angle[1] = radians * (180 / 3.14);

SetEntPropVector(ent, Prop_Send, "m_angRotation", angle);
}```
I assume that problem 1 and 2 can be solved by adding some noclip or movetype to the parent, but i dont know any DispatchKeyValue values (such as "targetname" for name)
And the problem 3 maybe could be solved by putting other model insted of C4 that can handle both angles and velocity?

I'd glady recive any kind of help from you
Rachnus
Senior Member
Join Date: Jun 2016
Location: Funland
 09-18-2017 , 06:30   Re: [CSGO] Force Velocity on Entity #7 Hmm, I mean the best solution would be to have someone make your model compatible with prop_physics (I have no clue how to do this) But... To fix your second error, if you're passing NULL_VECTOR into the angle parameter in TeleportEntity, replace it with whatever angle you want your ghoul to have. If you are passing an angle, just keep setting angle[0] to 0.0 to keep it up straight. You could also try change model from C4 to a barrel or something that has the same size as your ghoul. If you want to add me, feel free. __________________ Github: https://github.com/Rachnus Steam: http://steamcommunity.com/id/rachnus _____________________________________________ _________ Taking private requests
Vasto_Lorde
Junior Member
Join Date: Oct 2016
 10-02-2017 , 08:27   Re: [CSGO] Force Velocity on Entity #8 After experimenting with models and all: Solution: Insted of prop_physics for parent i used generic_actor. Its perfect - doesn't fall off, it can be angled, no sounds, its even solid etc. Thanks @Rachnus

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Server Discussion     Source Servers (SRCDS)     HL1 Servers (HLDS) AMX Mod X     News     Bug Reports     General     Off-Topic     Plugins         Suggestions / Requests         Approved Plugins         New Plugin Submissions         Unapproved/Old Plugins         Translation Request         High-Traffic Plugins             GunGame             UAIO (Ultimate All-In-One Plugin)             xREDIRECT             CSDM             AMX Super             RuneMod             Zombie Plague Mod             SuperHero Mod                 News                 Tech Support                 Scripting Help                 Off-Topic / General Chat                 Heroes                     Suggestions / Requests                     Approved Heroes                     New Submissions                     Unapproved/Old Heroes                         Module Heroes                     SuperHero Mod Stats - By 123                 (OLD) Bug Reports     Scripting         Scripting Help         Code Snippets/Tutorials         Module Coding     Donor Access SourceMod     News     General     Plugins         Plugins         Unapproved Plugins         Plugin/Gameplay Ideas and Requests         High-Traffic Plugins             SourceMod Anti-Cheat             Zombie:Reloaded             SourceBans             VSH / Freak Fortress             Store             SM_Hosties             HLstatsX:CE     Scripting     Extensions     Snippets and Tutorials     Donor Access     Metamod: Source         Metamod:Source Plugins         Metamod:Source Questions         Coding MM:S Plugins & SM Extensions Hosted Stuff     Asherkin's Plugins         TF2Items         TFDodgeball         SteamTools     Bail's Plugins         CSDM         CS:S DM Off-Topic & Trash     Off-Topic     Trash

All times are GMT -4. The time now is 21:25.

 DMCA - Archive - Top