dafydd99 Posted February 5, 2021 Share Posted February 5, 2021 Hi all, I'm currently looking at ways I could 'fling' the player from one location to another. My script currently allows a player to activate, then positions them and stops their movement before using ApplyHavokImpulse to 'rag doll throw' them. I want the 'fling' to land the player at the exact same spot no matter what size they are ('rag doll' wobbling aside!). This seems to work quite well, but as is often the case, the documentation is a little thin on the ground. It seems to follow my basic undestanding of physics reasonably well - F=ma so greater the mass of the player the less the acceleration and therefore distance flung. So my questions are:How do I provide a force which matches the weight of the character to always throw them the same distance? I know there's a GetWeight() that might do, but that's SKSE and I'm trying to avoid the extra dependencyIs the weight based only on the base characer statistics or does the armour and inventory they carry make any difference?Are there, say, just three weights for the character (light, medium, heavy) or is it calculated to the pound?Can the force applied take any value or would the engine round it some to an exact amount (eg just 50,100,150, rather than a value like 104.345)? Thanks for any help! Cheers - dafydd99 Link to comment Share on other sites More sharing options...
dafydd99 Posted February 8, 2021 Author Share Posted February 8, 2021 okay - have investigated further and it there seems to be a correlation between height and impulse. if you multiply the force applied by the height of the player by the force it seems to behave the same for all characters. Sounds like a bit of a short cut was made, as the weight of the character, and indeed their clothes or inventory seems to have no effect on their 'fling'. Link to comment Share on other sites More sharing options...
anjenthedog Posted February 9, 2021 Share Posted February 9, 2021 Well I suppose you could use a modified height value [(weight/100) * height], or [(100/weight)* height] if you want lighter bodies to fling farther, as long as you can do the substitution in situ. for the second case (h*100/w) you'll want to use a Begin (or the JS/etc equivalent) to make sure you have a rescue/escape for case (weight = 0), or design the If/Then to avoid the blow up at w=0 Link to comment Share on other sites More sharing options...
dafydd99 Posted February 9, 2021 Author Share Posted February 9, 2021 Thanks for the help, anjenthedog. I think the Weight columns in that table just aren't used for this. I've no idea why some are 1.0 and others 0.5. It seems random and might be meaningless in the game. So the way I've worked it out is just to apply an impulse equal to base_value*height where height is taken from race and gender in effectively an in-script look up table. I'm around 95% sure now the only factor involved is height. I've thrown the player around 300ft and can get them to land accurately on a rug for all races and 'weights'. Ideally I'd like to be able to use an 'aim' xmarker, but that'd take a bit of maths relating to differences in height of the start and destination of fling, and working out flight angles/velocity etc - for the moment the xmarker distance away will be the force multiplier. Link to comment Share on other sites More sharing options...
Recommended Posts