FutureVisions Posted December 7, 2010 Share Posted December 7, 2010 Hi. So basically I want to make a script that will make a selected type of creature, spawn in a selected room and in a selected amount.Even though it may sound simple it's not. lol. At least not for me. I already started writting a test script to do this, but the only thing I managed to do so far, was to get only 1 creature to spawn. I really don't have a good idea of how this can be done or if there's an easy way to do this. But I've reached a point where I'll need my script to go up and down... By this I mean for example: When the amount of creatures is set, I need the script to check for the type of creature that will spawn and then go back up to continue with the next step, which again, should make it go down to check for another type of creature and turn back up again, etc. So what I need to know is if anyone has a suggestion on how this script should be made or at least if there's a way to make the script "go to top" and "go to bottom" whenever is needed. If anyone can give me a hand with this, it will be greatly appreciated and proper credit given. I won't post my script here because at this point its already veeery long, but if you want/need to take a look at it, let me know and I'll upload the text file. Thanks, FV Link to comment Share on other sites More sharing options...
FutureVisions Posted December 7, 2010 Author Share Posted December 7, 2010 (edited) Ok so I've managed to get the spawning to work, while at the same time, considerably reducing the script size, Now I need to know how to optimize it. I'll need to reset the cell after Im done with it, does anybody know of a way to do it, while being inside the cell itself? Edited December 7, 2010 by FutureVisions Link to comment Share on other sites More sharing options...
FutureVisions Posted December 8, 2010 Author Share Posted December 8, 2010 Ok so I have a new problem now...random CTD. (great!)The only common thing about all these CTD's, is that I'll need to be inside my event cell. Other than that, the CTD can occur imediatly after entering the cell; a few seconds after entering, not crash after entering, it may crash on the event settings stage, - and at this point, the crash is also random . It may happen on any of the settings steps. (At this point nothing changes in the game world, only the script variables are being defined. The event script only starts running after the last step).- OR it might not crash at all. I've tested an retested the mod trying to improve the scripts a bit, but like I said, the CTDs sometimes happens and sometimes doesn't. Which is strange and makes the problem very hard to spot. :wallbash: Other thing that I noticed, that might be usefull is that, while inside the event cell, my pc's heat output sometimes increases dramatically and the fan shoots like cazy. Even though I can see no impact on frame rate. And without me, even having to interact with anything inside the cell. At this point I have only 4 scripts running at the same time in that cell, + 4 terminals that detemine the variables for the Event's script (and these shouldn't have an impact until activated, since they only have result scripts in them.)Resuming: I have the quest/event script, a light switch script, and a teleporter script, running on "Begin GameMode" blocks. And a trigger script running "OnTriggerEnter"/"OnTriggerLeave" blocks I'm not sure if the scripts might be competing or something. Which would be strange, Because none of them should be running at all until I activate something, since they're all proteted with a "start" var. Here is a fraction of the event script I have running. Please take a look at it maybe you can see something wrong.Any variables not determined here are the ones that are being determined by the stage setting terminals. SCN MyQuestScriptName short iRoom ;Determines the room where the creatures will spawn short iCount ;0==Easy Creatures Limit 20 ;1== Hard Creatures Limit 10 short iAmount ;Determines the amount of creatures that will spawn short iSpawn ;Determines how many creatures have spawned ref rCreatureRef ;Determines what creature was selected to spawn short StageSet ;Begins the script after all variables have been determined short DoOnce Begin GameMode if StageSet == 1 && DoOnce == 0 If ( iRoom == 1 ) if iAmount >= 1 && iSpawn < iAmount set iSpawn to iSpawn + 1 endif if iSpawn == 1 FVisionsRoom01Spawn01REF.PlaceAtMe rCreatureRef 1 if iAmount > 1 && iSpawn < iAmount set iSpawn to iSpawn + 1 endif endif if iSpawn == 2 FVisionsRoom01Spawn02REF.PlaceAtMe rCreatureRef 1 if iAmount > 1 && iSpawn < iAmount set iSpawn to iSpawn + 1 endif endif ;----[ETC, up to 10 (at this point- planning on 20 max)}-------------- Endif set StageSet to 0 ;---ROOM 2---- elseIf ( iRoom == 2 ) if iAmount >= 1 && iSpawn < iAmount set iSpawn to iSpawn + 1 endif if iSpawn == 1 FVisionsRoom02Spawn01REF.PlaceAtMe rCreatureRef 1 if iAmount > 1 && iSpawn < iAmount set iSpawn to iSpawn + 1 endif endif if iSpawn == 2 FVisionsRoom02Spawn02REF.PlaceAtMe rCreatureRef 1 if iAmount > 1 && iSpawn < iAmount set iSpawn to iSpawn + 1 endif endif ;----[ETC, up to 10 also] -------- Endif set StageSet to 0 set DoOnce to 1 Endif END Also If anyone has an idea of anything that might be causing a ctd that apparently is not related to something specific, please let me know,Sorry for the long post Link to comment Share on other sites More sharing options...
Recommended Posts