lgpmichael Posted October 31, 2011 Share Posted October 31, 2011 So, Im just working on a few finishing touches to the my mod (which will now be delayed till tuesday or so) and Im trying to sort a bug I have an NPC that isnt running their script. They are running their AI packages correctly, some of which depend on script variables, so the script is there, and its variables are known, but the script isnt running its gamemode block, and when clicked on, it isnt running its activate block either Now, if I move away from this NPC and then go back, their script starts to run just as it should do. I expect Ive got far enough away that it has unloaded and then reloaded the NPC. Anyone else ever seen this issue? Even better, anyone have a solution? Link to comment Share on other sites More sharing options...
jamochawoke Posted October 31, 2011 Share Posted October 31, 2011 Do you have continue if PC near checked in their AI packages? If so, uncheck it. Link to comment Share on other sites More sharing options...
The_Vyper Posted October 31, 2011 Share Posted October 31, 2011 Post your script so we can see where it might be going wrong. Otherwise, it'll be really hard to troubleshoot this issue. :laugh: Link to comment Share on other sites More sharing options...
jamochawoke Posted October 31, 2011 Share Posted October 31, 2011 He'll need to post the script and the AI Packages and what conditions they are using. Link to comment Share on other sites More sharing options...
lgpmichael Posted November 2, 2011 Author Share Posted November 2, 2011 It isn't the script or the AI packages. The same script and AI package work when the player moves a couple of cells away and comes back. The same script and AI package, The package is a travel to editor location, nothing special clicked, as the NPC was just supposed to stand there and ignore everything. (Ive fallen foul of the continue if near issue before, it isnt checked). The script was pared down to *nothing* except a messagebox in a gamemode, and I knew I was far enough away when the messagebox suddenly appeared, It was 100% reproducable. The script itself is fine. It is like the script wasn't loaded with the NPC. In testing I added an on activate block which was ignored, but after moving away, it worked when clicking on the NPC later. The AI package has no conditions, the entire purpose of the NPC is to stand still in one location, so that is its only package, and it has no conditions... It is - odd. Link to comment Share on other sites More sharing options...
jamochawoke Posted November 2, 2011 Share Posted November 2, 2011 Do you have like a million other mods and other scripts running at the same time? The game does have to go through each of them and scripts are usually looked at every 5 seconds or so by the game engine but for NPCs it should be faster. Link to comment Share on other sites More sharing options...
lgpmichael Posted November 2, 2011 Author Share Posted November 2, 2011 Do you have like a million other mods and other scripts running at the same time? The game does have to go through each of them and scripts are usually looked at every 5 seconds or so by the game engine but for NPCs it should be faster. About 40, as I was testing for mod compatibility - but it isn't that. Other NPC scripts were running fine, quest scripts at 5 seconds gap were running fine, it was just this one NPC. Left it there for an hour to check it wasn't time related, and the script didnt start firing. This is also a new NPC, not a mod of an existing one, and so there should be no mod mucking about with it that shouldnt or anything... Link to comment Share on other sites More sharing options...
jamochawoke Posted November 2, 2011 Share Posted November 2, 2011 Make another NPC that uses the same script and place them next to the original. See if the new NPC uses it correctly. Also you should really post your script. Link to comment Share on other sites More sharing options...
WarRatsG Posted November 7, 2011 Share Posted November 7, 2011 (edited) Agreed, post your script. Also, check for any return functions that may be preventing the gamemode block from kicking in. Return functions cut off the whole script, not just the current block. Sometimes, those blocks are allowed to kick in at certain moments, such as exiting a menu. Maybe leaving the area allows a block to start and a variable is changed. Finally, check some of the commands of the CS wiki - some functions have little quirks that can ruin scripts. Edited November 7, 2011 by WarRatsG Link to comment Share on other sites More sharing options...
lgpmichael Posted November 7, 2011 Author Share Posted November 7, 2011 Agreed, post your script. Also, check for any return functions that may be preventing the gamemode block from kicking in. Return functions cut off the whole script, not just the current block. Sometimes, those blocks are allowed to kick in at certain moments, such as exiting a menu. Maybe leaving the area allows a block to start and a variable is changed. Finally, check some of the commands of the CS wiki - some functions have little quirks that can ruin scripts. As I mentioned earlier, it definitely isnt the script. I replaced the script it should use with one that was: scn scriptname begin gamemode messagebox "test" end As a test, and it started firing when I walked far enough away and then walked back. It is an issue where the script seems to have not attached itself to the NPC, and then when you move out of local cell range, and then back in, it seems to load properly. Link to comment Share on other sites More sharing options...
Recommended Posts