EssArrBee Posted January 13, 2015 Share Posted January 13, 2015 I've been trying to edit the behavior of the Monocyte Breeder Implant to give 2 health for 30 seconds when combat starts and to only do it three times a day. After 30 seconds it returns to it's normal function. I've tried doing a few different ways but each way seems to freeze the game on entering combat when I test it out. Here is a way I tried by creating an ingestible that is added and equipped when combat starts: scn ImplantRegenScript ; First Monocyte Breeder Upgrade ; Increases regen rate 20% over base model ; Adds accelerated health regen int iNanobotCount float fMicroRegen float fDayReset Begin ScriptEffectStart set iNanobotCount to 0 set fDayReset to GameDaysPassed + 1 End begin ScriptEffectUpdate if fDayReset < GameDaysPassed ; check if day passed to reset three uses set fDayReset to GameDaysPassed + 1 set iNanobotCount to 0 endif if (Player.IsInCombat && iNanobotCount < 3) ;In combat player gets 2HP per second for 30 seconds AddItem TCxNanobotCombatRecovery 1 1 EquipItem TCxNanobotCombatRecovery 1 1 set iNanobotCount to iNanobotCount + 1 else ;Regular regen rate set fMicroRegen to ScriptEffectElapsedSeconds / 8 RestoreAv Health fMicroRegen endif end Begin ScriptEffectFinish RemoveItem TCxNanobotCombatRecovery 100 1 End The TCxNanobotCombatRecovery is supposed to be an ingestible that regens 2 HP for 30 seconds. I did it that was because, well, it was easy to make in the GECK. I think the problem may be that I'm using the wrong blocktype, but I've never really messed around with coding this stuff, so I'm still trying to learn the ins and out of each type. Any help is appreciated. Link to comment Share on other sites More sharing options...
tomm434 Posted January 13, 2015 Share Posted January 13, 2015 Well, first of all - variables in your script are spell variables - they exists only while spell works so you can't use them to store gameday. You need to use quest for that. And I don' really understand what you're trying to do here. Spell works only for its duration which means that code inside "begin ScriptEffectUpdate" will execute only while spell is active. I think it's better to create a quest for what you want to do instead of spell. Link to comment Share on other sites More sharing options...
EssArrBee Posted January 13, 2015 Author Share Posted January 13, 2015 Okay, thanks. The original Monocyte Breeder is in a scripteffectupdate blocktype, so I just tried to add to it. Link to comment Share on other sites More sharing options...
tomm434 Posted January 13, 2015 Share Posted January 13, 2015 You can use spell which lasts 30 seconds and restores 2 hp\sec.But to add that spell and to store gamedays and else you should use anything else (like Quest for instance) Link to comment Share on other sites More sharing options...
Recommended Posts