AdmiralKarlDonuts 0 Posted June 25, 2004 So I talked about a stamina script a while ago and Spinor managed to whip up something that altered a unit's skill based on loadout, speed and posture. I got to thinking...how about a morale script? My idea (I can't script this but someone might find it really useful) is to weigh a bunch of factors and derive an overall "morale" rating for the individual soldiers. Â As OFP stands now, a soldier will always perform the same way no matter what the circumstances. Â This script would alter his skill and the collective courage of the squad. Â For example, a soldier with good morale would be at his normal skill, whatever that is. Â If all the soldiers in a squad are at good morale, the overall morale of the squad would be high, thus meaning that the group's courage would be high. Â Anyway, here are some factors that could be used in a basic version of this script - for the individual soldiers: - ammo: Â if the soldier is low on ammo (however OFP determines this), then his morale goes down a bit. - stamina: spinor's script already calculates this, but for this script it would not affect the skill on its own - this result would be another factor. [here's a link to the stamina script so that it can be incorporated here:] http://www.flashpoint1985.com/cgi-bin....t=36657 So take a look at Spinor's script, then see if you can apply the same idea to this morale script. Â Obviously the rate of fatigue in his script would be made much lower so that the AI wouldn't be sitting down and having a rest. Basically take the results from the computation of the factors you choose to include, then use the combination of the factors to arrive at a morale modifier. Simple, right? I dunno, maybe this is impossible, but I figured I'd throw the idea out there in case someone was interested Share this post Link to post Share on other sites
newiy 0 Posted June 25, 2004 Funny you asked.... I was working on a morale script earlier this month for private use, but it is still very buggy and it takes into account several factors like: Enemy Distance (I used Average distance of all known enemies) Strength of enemy vs. Friendly strength. (I made AI overvalue friendly strength...) Average damage of the group. And a bias value of sorts... This bias is supposed to account for things like low ammo (haven't implemented this yet), current state etc... I made it affect what "scripted" behaviours I have made available to the AI, but the system is still not too reliable, the AI will surrender inappropriately... etc... I don't think it can really be used in MP, but does it makes the AI a *little* bit smarter in SP, though it is still as blind as a bat esp. in CQB. The script lags because of the amount of functions I use. I'll post a skeleton of my system (don't think I'll finish it, ever!) if anyone is interested, and some related functions. Share this post Link to post Share on other sites