Difference between revisions of "Category talk:Scripting"

Jump to navigation Jump to search
514 bytes added ,  18:22, 11 July 2006
→‎Script Limit: reorganization, and more talk
imported>ShadowDancer
(possible alternatives)
imported>DragoonWraith
(→‎Script Limit: reorganization, and more talk)
Line 18: Line 18:
:::[[User:ShadowDancer|ShadowDancer]] 20:57, 4 July 2006 (EDT): I wonder if its Characters (with spaces)?  It seems to me that this number is close to 32,767 and might be a memory limit maybe with filesize overhead?
:::[[User:ShadowDancer|ShadowDancer]] 20:57, 4 July 2006 (EDT): I wonder if its Characters (with spaces)?  It seems to me that this number is close to 32,767 and might be a memory limit maybe with filesize overhead?


::::[[User:Scruggs|Scruggs]] 19:30, 10 July 2006 (EDT) I would think it would be a limit of the ''compiled'' script, not the actual text, but i can't say that for sure. If you want to reduce the size of a script, though, you can transfer some of your if blocks into quest stages or dialog topics, setting up the conditions to do the work for you. Then just call [[setStage]] or [[Say]] to run the conditions. [[Say]] is useful when you need the results to run on the calling actor, which setStage won't allow.
:::[[User:ShadowDancer|ShadowDancer]] 09:12, 11 July 2006 (EDT): K, I have the actual answer.  The limit '''is''' 32,767 and its the number of characters '''including special characters''' i.e. the enter key.  If you add the number of lines to the number of characters (with spaces), you end up with 32,768 and since there isn't a return after the last line, that is one less return which results in 32,767.  It is probably just an artificial limit in the base programming (probably visual basic) creating the scriptedit box.
 
::::[[User:DragoonWraith|<font face="Oblivion,Daedric" size=3>D</font>ragoon <font face="Oblivion,Daedric" size=3>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 10:13, 11 July 2006 (EDT): I know little about how you would program the script editor, but is it possible to have a limitless box? Because I really would like to write a script about 5x or 6x the size of the limit...


::::::[[User:ShadowDancer|ShadowDancer]] 09:12, 11 July 2006 (EDT): K, I have the actual answer.  The limit '''is''' 32,767 and its the number of characters '''including special characters''' i.e. the enter keyIf you add the number of lines to the number of characters (with spaces), you end up with 32,768 and since there isn't a return after the last line, that is one less return which results in 32,767.  It is probably just an artificial limit in the base programming (probably visual basic) creating the scriptedit box.
:::::[[User:ShadowDancer|ShadowDancer]] 12:17, 11 July 2006 (EDT): Umm, in theory?  Yes.  The trick is that they would need to change the coding of the construction set program (and possibly Oblivion depending on how it deals with the script file). I am going to assume that the construction set was built using visual basic (which may or may not be true)The problem comes from the use of the control (a text box I think) used to create the scriptedit window.  This is why there is a limit on the amount of characters that it will hold (32,767).  They would essentially need to rewrite the construction set and do something similar to MS Word so that more characters could be held in the scriptedit window.  I don't know if that involves multiple "text boxes" or a completely different control, but that is essentially the issue.


:::::::[[User:DragoonWraith|<font face="Oblivion,Daedric" size=3>D</font>ragoon <font face="Oblivion,Daedric" size=3>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 10:13, 11 July 2006 (EDT): I know little about how you would program the script editor, but is it possible to have a limitless box? Because I really would like to write a script about 5x or 6x the size of the limit...
::::::After checking around a bit, short of someone writing a program to edit the .esp files and make the scripts in them fully readable and recompiled on save, I dont know how you would write a script longer than the current limit. And even then, Oblivion itself might have problems trying to deal with the script.


::::::::[[User:ShadowDancer|ShadowDancer]] 12:17, 11 July 2006 (EDT): Umm, in theory?  Yes.  The trick is that they would need to change the coding of the construction set program (and possibly Oblivion depending on how it deals with the script file).  I am going to assume that the construction set was built using visual basic (which may or may not be true). The problem comes from the use of the control (a text box I think) used to create the scriptedit window. This is why there is a limit on the amount of characters that it will hold (32,767).  They would essentially need to rewrite the construction set and do something similar to MS Word so that more characters could be held in the scriptedit window.  I don't know if that involves multiple "text boxes" or a completely different control, but that is essentially the issue.
:::::::[[User:DragoonWraith|<font face="Oblivion,Daedric" size=3>D</font>ragoon <font face="Oblivion,Daedric" size=3>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 15:28, 11 July 2006 (EDT): I was actually thinking about how plausible it would be for Bethesda to remove the limit, not a modder. Obviously a modder would have significant trouble doing so. Anyway, your answer makes it clear that changing it would be quite a hassle for them, so I can't hope for that.


::::::::After checking around a bit, short of someone writing a program to edit the .esp files and make the scripts in them fully readable and recompiled on save, I dont know how you would write a script longer than the current limitAnd even then, Oblivion itself might have problems trying to deal with the script.
::::::::[[User:ShadowDancer|ShadowDancer]] 18:00, 11 July 2006 (EDT): Thats not necessarily true.  It is possible that only the construction set might need to be changed.  The scripts in the mods are all in the .esp files so it all depends on how the game actually functions and uses scripts.  And its quite possible that a 2nd party script editor could be written since the .esp file shows pretty much all of the script when opened in MS Word.  There are a bunch on other characters that don't show properly or are other symbols maybe, but it looks like it is fairly consistant.  It might even be possible to write as much as you can in the construction set and then open the .esp file and paste in the restThe answer to that would require an experiment on the .esp file and would also test how Oblivion handles longer scripts.


[[User:DragoonWraith|<font face="Oblivion,Daedric" size=3>D</font>ragoon <font face="Oblivion,Daedric" size=3>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 15:28, 11 July 2006 (EDT): (back to left) I was actually thinking about how plausible it would be for Bethesda to remove the limit, not a modder. Obviously a modder would have significant trouble doing so. Anyway, your answer makes it clear that changing it would be quite a hassle for them, so I can't hope for that.
:::::::::[[User:DragoonWraith|<font face="Oblivion,Daedric" size=3>D</font>ragoon <font face="Oblivion,Daedric" size=3>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 19:22, 11 July 2006 (EDT): (that was getting confusing, I reorganized things to make both conversations make sense - unfortunately that means being rather far to the right) Hmm... this certainly is interesting. I don't even have the know-how to ''test'' that, but I'd definitely be interested in the results.


:[[User:ShadowDancer|ShadowDancer]] 18:00, 11 July 2006 (EDT): Thats not necessarily true.  It is possible that only the construction set might need to be changed.  The scripts in the mods are all in the .esp files so it all depends on how the game actually functions and uses scripts.  And its quite possible that a 2nd party script editor could be written since the .esp file shows pretty much all of the script when opened in MS Word.  There are a bunch on other characters that don't show properly or are other symbols maybe, but it looks like it is fairly consistant. It might even be possible to write as much as you can in the construction set and then open the .esp file and paste in the rest. The answer to that would require an experiment on the .esp file and would also test how Oblivion handles longer scripts.
::::[[User:Scruggs|Scruggs]] 19:30, 10 July 2006 (EDT) I would think it would be a limit of the ''compiled'' script, not the actual text, but i can't say that for sure. If you want to reduce the size of a script, though, you can transfer some of your if blocks into quest stages or dialog topics, setting up the conditions to do the work for you. Then just call [[setStage]] or [[Say]] to run the conditions. [[Say]] is useful when you need the results to run on the calling actor, which setStage won't allow.


:::::[[User:DragoonWraith|<font face="Oblivion,Daedric" size=3>D</font>ragoon <font face="Oblivion,Daedric" size=3>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 19:58, 10 July 2006 (EDT): I actually do have ways around it, but since I'm not sure how that would work... how would you use [[Say]]?
:::::[[User:DragoonWraith|<font face="Oblivion,Daedric" size=3>D</font>ragoon <font face="Oblivion,Daedric" size=3>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 19:58, 10 July 2006 (EDT): I actually do have ways around it, but since I'm not sure how that would work... how would you use [[Say]]?


: [[User:Scruggs|Scruggs]] 21:13, 10 July 2006 (EDT) Each dialog topic can have multiple responses, with each response having a different set of conditions. When you call ''Say'', the calling actor picks the response(s) in that topic for which he passes the conditions, and runs the result script on himself. There is no text and no voice associated with the responses. A simple (and stupid) example: you created a spell that kills the target, if he belongs to any of the five joinable factions. You could either add a separate if-elseif to your script for each faction, or you could set up a topic with 5 responses filtered for each of the guilds. So the first response's condition would be '''getInFaction magesGuild == 1.00''' and it's results would be '''kill'''. Calling '''Say myTopic''' from your script turns several lines of code into just one line.
::::::[[User:Scruggs|Scruggs]] 21:13, 10 July 2006 (EDT) Each dialog topic can have multiple responses, with each response having a different set of conditions. When you call ''Say'', the calling actor picks the response(s) in that topic for which he passes the conditions, and runs the result script on himself. There is no text and no voice associated with the responses. A simple (and stupid) example: you created a spell that kills the target, if he belongs to any of the five joinable factions. You could either add a separate if-elseif to your script for each faction, or you could set up a topic with 5 responses filtered for each of the guilds. So the first response's condition would be '''getInFaction magesGuild == 1.00''' and it's results would be '''kill'''. Calling '''Say myTopic''' from your script turns several lines of code into just one line.


: Obviously, it's not a huge benefit when you're only testing for five conditions, but if you're approaching the limit for script length it could be very useful. I'm still trying to figure out if NPCs will say ''all'' of the responses within that topic for which they pass the conditions, or just the first one that matches. If they only speak one response, you could most likely chain them up by calling ''Say'' again in the results field. That would let you check for all conditions (such as checking for all factions to which a NPC might belong, instead of just one).
: Obviously, it's not a huge benefit when you're only testing for five conditions, but if you're approaching the limit for script length it could be very useful. I'm still trying to figure out if NPCs will say ''all'' of the responses within that topic for which they pass the conditions, or just the first one that matches. If they only speak one response, you could most likely chain them up by calling ''Say'' again in the results field. That would let you check for all conditions (such as checking for all factions to which a NPC might belong, instead of just one).

Navigation menu