crippknottick Posted October 22, 2010 Share Posted October 22, 2010 I have just a couple of questions as of now. I'll reuse this thread if I have anymore questions since they will all be related to a single mod I'm working on. But if I learn anything to help me out on future projects that would be great also. 1. Does fQuestDelayTime have to be set every time a quest script runs in order to keep the set delay time? Like for example: scn QuestScript float fQuestDelayTime begin gamemode set fquestdelaytime to 30.0 endif end Or can it be set just once and the delay time is set in stone for that quest script even after loading a saved game? For example: scn QuestScript short DoneOnce float fQuestDelayTime begin gamemode if DoneOnce == 0 set fquestdelaytime to 30.0 set DoneOnce to 1 endif end 2. What is the best method of keeping track of the kills by a particular NPC? Ref.GetDead hasn't been too nice to me so far. I either end up with no counting of the kills (Exhibit A), or for example in my most recent revision of the script below I end up with thousands of kills because it won't stop counting (Exhibit B). I tried using short variables to switch on and off the counting but that ends up with no counting at all. The script is an object script. I think I read somewhere that some functions could end up making a return function occur halting the rest of the script. Could this be the case here? Exhibit A Never Counting scn 0MajinBuuScript float timer ref BuuRef ref BuuTargetRef begin gamemode ; Who is Buu targeting? if BuuRef.IsInCombat == 1 set BuuTargetRef to BuuRef.GetCombatTarget endif ; keep track of kills if BuuTargetRef.GetDead == 1 && BuuKilled == 0 set BuuKilled to 1 endif BuuKilled == 1 set PetBuu.BuuKillCount to PetBuu.BuuKillCount + 1 set BuuKilled to 0 endif Exhibit B Always Counting scn 0MajinBuuScript float timer ref BuuRef ref BuuTargetRef begin gamemode ; Who is Buu targeting? if BuuRef.IsInCombat == 1 set BuuTargetRef to BuuRef.GetCombatTarget endif ; keep track of kills if BuuTargetRef.GetDead == 1 set PetBuu.BuuKillCount to PetBuu.BuuKillCount + 1 endif . Link to comment Share on other sites More sharing options...
slygothmog Posted October 23, 2010 Share Posted October 23, 2010 I will answer your first question.Once you set the fQuestDelayTime value, in a begin gamemode block, the script will always be run at that value. scn aaadelaytime float fQuestDelayTime begin gamemode set fQuestDelayTime to 2 end This will force the game to run the script every 2 seconds instead of the default 5 seconds, this is never ending because the begin gamemode block acts like a loop script, repeating itself over and over. Link to comment Share on other sites More sharing options...
crippknottick Posted October 24, 2010 Author Share Posted October 24, 2010 I will answer your first question.Once you set the fQuestDelayTime value, in a begin gamemode block, the script will always be run at that value. scn aaadelaytime float fQuestDelayTime begin gamemode set fQuestDelayTime to 2 end This will force the game to run the script every 2 seconds instead of the default 5 seconds, this is never ending because the begin gamemode block acts like a loop script, repeating itself over and over. But does it carry over after loading a game being set only once? Like with a DoneOnce switch? Link to comment Share on other sites More sharing options...
slygothmog Posted October 24, 2010 Share Posted October 24, 2010 Yes, it always carries over...it's set in stone as you like to say...it will always be that value and the script will always run at that speed unless you alter the script itself.Begin gamemode is a block that repeats itself over and over, and once it reads the fQuestDelayTime value, it will always use that value every time it runs the script. Link to comment Share on other sites More sharing options...
crippknottick Posted October 25, 2010 Author Share Posted October 25, 2010 Thanks, slygothmog. Now I am ready to get my hands dirty again. :) Link to comment Share on other sites More sharing options...
Recommended Posts