Scripting...

Talk about your new mod or map here

Moderators: jelco, bert_the_turtle

Krion112
level2
level2
Posts: 114
Joined: Sat Nov 15, 2008 4:24 am

Scripting...

Postby Krion112 » Sun Mar 06, 2011 6:59 pm

Alright, so I've been having an odd issue that I couldn't find an answer for here on the forums. The Issue is that whenever I make Sepulveda, or whatever character I have chatting, say a couple lines of strings in a script, they say all the lines except the last. For example:

Code: Select all

guardians_engineer_1
guardians_engineer_2
guardians_engineer_3
guardians_engineer_4


He'll say guardians_engineer_1, 2, and 3, but not 4.

If I missed something on the forums, or you have an answer, give me a link or respond because this is annoying, and I dont want to end up scripting dummy strings to make it work, when there's some other way to get it to function...
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Sun Mar 06, 2011 8:06 pm

Do all of your files end with empty lines?

xander
Krion112
level2
level2
Posts: 114
Joined: Sat Nov 15, 2008 4:24 am

Postby Krion112 » Sun Mar 06, 2011 10:28 pm

You mean like in my strings_default it would go:

Code: Select all

guardians_engineer_1
guardians_engineer_2
guardians_engineer_3
guardians_engineer_4
<empty space>


?
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Mon Mar 07, 2011 12:14 am

Krion112 wrote:You mean like in my strings_default it would go:

Code: Select all

guardians_engineer_1
guardians_engineer_2
guardians_engineer_3
guardians_engineer_4
<empty space>


?

Yes. Every file should end with an empty line. If a file does not end in an empty line, the last line will not be read. Also, what, exactly, is the script that you are calling? Please post a copy of that file. I might also be nice to see the appropriate portion of your strings_default.txt file.

xander
Krion112
level2
level2
Posts: 114
Joined: Sat Nov 15, 2008 4:24 am

Postby Krion112 » Mon Mar 07, 2011 3:45 am

Alright, the Script:

Code: Select all


Say guardians_engineer_1
Say guardians_engineer_2
Say guardians_engineer_3
Say guardians_engineer_4



And the Strings (with the actual text cut out)

Code: Select all


guardians_intro_1               
guardians_intro_2               
guardians_intro_3               
guardians_intro_4               

guardians_engineer_1           
guardians_engineer_2           
guardians_engineer_3           
guardians_engineer_4     
       
guardians_island_1   
           
guardians_objective_1           
guardians_mission_1a           
guardians_mission_1b
           
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Mon Mar 07, 2011 2:56 pm

Right off, I don't see the problem. You might try adding a "WaitSay" command to the end of your script, and see if that helps. Also, is it not saying anything for the last line of dialog, or is it putting up a string not found error? What, exactly, is happening? Could you post a screenshot?

xander
Krion112
level2
level2
Posts: 114
Joined: Sat Nov 15, 2008 4:24 am

Postby Krion112 » Mon Mar 07, 2011 11:32 pm

Well, the problem was that Sepulveda wouldn't read the last line of text. I just added a new level and added new scripts, and then you told me about the last line having to be an empty space, which seems to have worked. He does indeed say every line now. I've also placed in some WaitSay commands, just to be safe.
ItchyDani3l
level1
level1
Posts: 11
Joined: Tue May 01, 2012 7:46 pm

Postby ItchyDani3l » Sat May 05, 2012 9:39 pm

(Epic Bump)

Well apparently the last line doesn't need to be empty necessarily.
You could put any old garbage you want on the last line, it's just it will be ignored.

This is usually a blank line because of this.
Theoretically you could like make an ASCII drawing of a man being chased by a shark on the last line and the game wouldn't care.

,.,.,.,.,.,.,.\o/,.,.,.,.,.,/|,.,.,.,.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Sat May 05, 2012 11:13 pm

Yes. That is true. In fact, that is implied by what I wrote last year:

xander wrote:Yes. Every file should end with an empty line. If a file does not end in an empty line, the last line will not be read.


The file doesn't need to end in an empty line, but the last line will not be read, so there is no point in putting anything in the last line. You can fill it with random garbage, but why bother?

xander

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 8 guests