Difference between revisions of "Getting started with TSFC"

384 bytes removed ,  10:32, 15 April 2010
no edit summary
imported>Tibixe
(a new function)
imported>Darkness X
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Tools|req0=[[The Elder Scrolls Construction Set|Construction Set]]|req1=[[OBSE]]|req2=[[:Category:TSFC|TSFC]]}}
==You should already know==
==You should already know==
* Commands and variables in Oblivion scripts
* Commands and variables in Oblivion scripts
Line 4: Line 5:


==Background==
==Background==
[http://cs.elderscrolls.com/constwiki/index.php/Category:TSFC Tibixe's String Function Collection] ([[TSFC]]) is an [[OBSE]] plugin which extends Oblivion scripting with string variables. Strings are sequences of characters, like "apple". There are a few existing commands that accept strings as arguments, such as
[http://cs.elderscrolls.com/constwiki/index.php/Category:TSFC Tibixe's String Function Collection] ([[:Category:TSFC|TSFC]]) is an [[OBSE]] plugin which extends Oblivion scripting with string variables. Strings are sequences of characters, like "apple". There are a few existing commands that accept strings as arguments, such as
  SetActorFullName "Player's Horse"
  SetActorFullName "Player's Horse"
But you can't do this
But you can't do this
Line 162: Line 163:
This will print "Hello World", because the first call to StrNew/StrGetSomething will always return 1 (the next call will return 2, after that 3 and so on).
This will print "Hello World", because the first call to StrNew/StrGetSomething will always return 1 (the next call will return 2, after that 3 and so on).
StrPrint finds the first string and can print it.
StrPrint finds the first string and can print it.
If you want to save memory (which is not worth the effort in most cases), you can rewrite the above example with only one variable:
If you want to save memory (which is not worth the effort in most cases), you can rewrite the above example with only one variable.
 
short playername
short playername+1
short playername+2
short playername+3
short playername+4
begin ScriptEffectStart
set playername to player.StrGetName
set playername+1 to StrGetName
set playername+2 to StrNew "'s"
StrCat playername playername+2
StrCat playername+3 playername+1
StrSetName playername+4
StrDel playername
StrDel playername+1
StrDel playername+2
StrDel playername+3
StrDel playername+4
end
Of course, this is an extreme example, but demonstrates that variables do not really matter.


==How to continue==
==How to continue==
Browse the [[TSFC]] documentation here at the Wiki for detailed descriptions of TSFC commands.
Browse the [[:Category:TSFC|TSFC]] documentation here at the Wiki for detailed descriptions of TSFC commands.
If you know C++, you can browse the current TSFC source code [[http://obse-plugins.svn.sourceforge.net/viewvc/obse-plugins/TSFC/ here]].
If you know C++, you can browse the current TSFC source code [[http://obse-plugins.svn.sourceforge.net/viewvc/obse-plugins/TSFC/ here]].


Anonymous user