Fixing http://www.gamesas.com/index.php?/topic/1097715-relz-khuul-expanded/page__p__16037529__fromsearch__1entry16037529
Working on perfecting/releasing http://www.gamesas.com/index.php?/topic/1032302-wipz-realistic-combat/page__p__14952602__fromsearch__1entry14952602
Working on a crime/evil mod that lets player do evil things, and fleshes out guard reactions and "wanted levels."
An innovative TC that isn't ready for recruitment yet.
I've made sporadic attempts at creating a Morrowind Crafting compatible addition that allows you to either cut or collect wood. My initial attempts got to where you could equip any standard axe and swing it at any tree "marked for cutting", causing a log to fall at your feet. This was very unrealistic, and not at all what I wanted as an "end product", but proved the concept and basic core of the script. The next stage was to have the "attack" apply damage to the tree or fallen branch until it was reduced to 0, which would THEN generate the logs. It was also supposed to apply gradual wear on the weapon to prevent you from running around non-stop and hacking down all of the trees in the game. These stages I failed miserably at doing, despite all sorts of workarounds using spell effects, converting the tree into a creature for the second that it took for the axe to hit and do damage, and all sorts of other weird methods to apply damage to both target and weapon. Sad to say, but so far, the CS has been getting the better of me.
Second attempt was to have the trees occasionally drop fallen branches, which you could cut up with your axe and collect as logs, rather than chop the whole tree down. This would have the advantage of not depleting the trees in the game, while providing a slowly renewable source of wood. Lack of decent models for the branches have all but put a stop to that, since I don't want anything like the heavy fallen trees that are currently used in the game, such as along the shoreline East of Suran. Eventually, I'll get back to it, even if I have to learn how to make the branches myself from scratch.
With nothing "useful" to show for the effort so far, I'm currently taking a break from the game to do a few other things (painting historical military miniatures, playing a historical computer wargame for a bit, fixing my house, etc.). After a couple of months, the urge to fire up MW again will hit as it usually does, and then I'll start taking a renewed interest in modding it.
Do you need help with this? Here is what you do:
Each "tree" that is chop-able must have a script upon it, and therefore all MW trees must be converted to activators. This is pretty easy to do and has probably already been done for you.
Within the script of the tree, we need to first detect the player's actions. We also need to define the hit points of the tree. That said...
Begin CT_SampleTreeScriptShort TreeHP ;Tree's HP.Short SwingState ;Necessary to assure tree's response to player's swing happens only once.Short Calculating ;To grab PC's strength.Float DamageTimer ;Time the degredation spell remains on you.If ( SwingState == 0 ) Set TreeHP to 100 Set SwingState to 1EndifIf ( SwingState == 1 ) ;This needs to happen once, not every frame. If ( GetDistance Player < 200 ) ;The player should be close to the tree. If ( Player->GetSoundPlaying "Weapon Swish" == 1 ) ;This is to detect the player's swing. Set SwingState to 2 ;To keep code block from repeating. PlaySound "Chop Sound" ;Whatever you choose... Set Calculating to ( Player->GetStrength ) ;Grabbing player's strength. Set TreeHP to ( TreeHP - Calculating ) ;Stronger player is, the more damage you do. Player->AddSpell "Degrade Weapon" ;This should be your own spell, a "disease" that damages your weapon. Endif EndifEndifIf ( SwingState >= 2 ) ;Next step... Set DamageTimer to ( DamageTimer + GetSecondsPassed ) ;We need to set this timer.EndifIf ( DamageTimer > 0.5 ) Set SwingState to 3 Set DamageTimer to 0 Player->RemoveSpell "Degrade Weapon" ;This assures this "disease" remains on the player for half a second.EndifIf ( SwingState == 3 ) ;Weapon has swung... damage to weapon has been done, damage to tree has been done. If ( Player->GetSoundPlaying "Weapon Swish" == 0 ) ;But isn't swinging anymore. Set SwingState to 0 ;Reset. EndifEndifIf ( TreeHP <= 0 ) If ( SwingState != 4 ) Set SwingState to 4 ;PRODUCE LOG...whatever code you wanna use. Tree should be dead. Endif ;Reset SwingState to 0 and TreeHP to 100 to resurrect tree.EndifEnd of this tree script.
Try this approach. You might wanna make a Player->GetWeaponType check somewhere in that script to prevent it from running unless the player has an axe equipped.