Jump to content

Script Help: Chance to Fall Down with Crippled Legs


Thacker

Recommended Posts

Even with the indispensable GECK PowerUp, the GECK's compiler will still miss certain errors such as extra endif statements. It might be a good idea for you to run your scripts through my script validator until you get more accustomed to the syntax, as it will detect a few errors the the GECK's compiler may miss, as well as other potential issues.

That is an interesting point. Is your script validator code completely unrelated to the geck/game engine parser? Is your list of function names and "prototypes" (function arguments) known to be the same as geck/engine? In case of a difference, which one is "right"?

Link to comment
Share on other sites

Thanks for considering my request; you should also do the "easier crippled limbs" request, it seems itd be much more simple that the "fall down with crippled limbs" request.

 

As an alternative you may want it to be that they fall down if the legs are shot, if you find the current scripting too hard that is.

Edited by mrbic
Link to comment
Share on other sites

@mrbic

 

I didn't realize you had requested this. I was making it for my own use. If I get it to work, I suppose I can post on Nexus (or at least send it to you).

 

A knockdown onhit shouldn't be too hard to do (gethitlocation?). Though since I'm only doing this for personal use, I doubt I'll make it (or maybe I will for practice).

 

@Cipscis

 

In regards to the GameMode, I was more interested in the rate it causes the script to be run, then actually modifying that rate. If the script runs every frame, and there are 60 frames a second, then with a 5% chance to knockdown per frame, statistically speaking the character will be knocked down constantly. Basically I'm concerned with how often the script is run/updated since that will influence what value for the knockdown is acceptable. From what you said, it sounds like I will need to incorporate GetSecondsPassed into the script to keep a constant chance. Fun...

Link to comment
Share on other sites

A knockdown onhit shouldn't be too hard to do (gethitlocation?). Though since I'm only doing this for personal use, I doubt I'll make it (or maybe I will for practice)

 

Unfortunately GetHitLocation doesn't work like that. According to the Wiki (and my experience) it only detects the last hit in certain circumstances such as the death blow.

 

It's still possible to detect a hit location, but it requires a bit of a work around.

Link to comment
Share on other sites

Glowcat, what's your way of getting around it? i was planning something that needed to get the hit location but as you said, i also read on the geck that gethitlocation wont do the job i want. i was thinking of getting the health of the limbs and seeing which took damage for that but im not sure how well that would go either
Link to comment
Share on other sites

I am a little surprised this script compiles, because it has several extra endif's. I suggest you read about the scripting language at cipscis.com. Here is a version which seems more correct, but I did not test:

 

Begin GameMode
If Player.HasMagicEffect MorphineEffect == 0  
	If (player.getav LeftMobilityCondition == 0) || (player.getav RightMobilityCondition == 0)
		If GetRandomPercent <= 5
			player.pushactoraway player 3    
		EndIf 
	ElseIf (player.getav LeftMobilityCondition == 0) && (player.getav RightMobilityCondition == 0)
		If GetRandomPercent <= 10 
i				player.pushactoraway player 3 
		EndIf 
	EndIf 
Endif
end

 

Also, you did not say what object this is attached to. If you want it always running, you may have to make it a quest script.

 

HAHA! IT WORKS!

 

If I could give you extra kudos davidlallen I would. It works beautifully now. I had to create a dummy quest and change the script to quest, but other than that it works just as I had imagined.

 

But... now that I see it in action I think it needs some tweaking. The "knockdown" that occurs with pushactoraway applies a vertical force upwards on the actor; you do a little "jump" before you fall down. It's only noticeable in 3rd person, and even then barely. Is this because the reference and target are one and the same? Is there a way to make it seem more natural? I recall in Oblivion that if your fatigue was reduced to 0 you would fall prone (maybe that was a mod?) and it looked abit more natural than this this little "jump".

 

Secondly, I'm not sure I like the morphine effect of ignoring crippled limbs. Maybe changing it to restore only a certain amount of mobility, as opposed to full mobility? Though I'm not sure how to do that since I modded the movement penalties (fMoveOneCrippledLegMult and fMoveTwoCrippledLegsSpeedMult). Can scripts modify settings? Or can that only be done in the GECK?

 

And thirdly, I really need to figure out someway to apply this to all actors. Doesn't seem fair that I'm the only one falling over.

 

Thanks for help!

Link to comment
Share on other sites

Glowcat, what's your way of getting around it? i was planning something that needed to get the hit location but as you said, i also read on the geck that gethitlocation wont do the job i want. i was thinking of getting the health of the limbs and seeing which took damage for that but im not sure how well that would go either

 

That's basically what I had to do.

 

Unfortunately the method I used is adapted specifically to one-on-one fights were normal game crippling is disabled, and crudely works by restoring all limb condition and then detecting for limb damage on hit before restoring the limb condition again. I don't see it working with conventional combat at all, especially since the script is tied to the weapons used.

 

However, I suspect something similar could be done by detecting the limb health of either the actor under the player's target or the NPC's combat target and then keeping track of whenever the target's limb health changes. It might need to be limited to players and their opponents though, and multiple fighters would complicate matters... though even then a system of non-playable tokens combined with checking all nearby references may do the trick.

 

I tend to take a hammer to these problems bang them out until something works. Most of the experts around here probably have better ideas.

Link to comment
Share on other sites

I am sure you lookup interesting functions at the geck.bethsoft.com wiki. In some cases these pages simply point to the older TES wiki. In some cases the TES wiki has additional information which is not present on the geck pages. So it is often interesting to repeat a search on the TES wiki. At this link I found this interesting comment:

 

Using the same reference for pusher and pushed will have send the actor straight up into the air if force is positive, and will crumple the actor to the ground if force is negative. Using only pushed reference will have the same result.

 

So, try negative force.

Link to comment
Share on other sites

I am sure you lookup interesting functions at the geck.bethsoft.com wiki. In some cases these pages simply point to the older TES wiki. In some cases the TES wiki has additional information which is not present on the geck pages. So it is often interesting to repeat a search on the TES wiki. At this link I found this interesting comment:

 

Using the same reference for pusher and pushed will have send the actor straight up into the air if force is positive, and will crumple the actor to the ground if force is negative. Using only pushed reference will have the same result.

 

So, try negative force.

 

Seriously. Dude. +5 kudos.

 

Really appreciate the help! Guess I'll have to bookmark the TES wiki as well now too.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...