Is there an easy way to insert a cr/lf or newline sequence into a string. If not I'll just have to create a small include file that contains just const statement, compile it and then hack it with a hex editor. Don't know if that would work and it seems a lot of work a simple need.
TR
Is there an easy way to...
Débuté par
Tarot Redhand
, avril 05 2011 09:55
#1
Posté 05 avril 2011 - 09:55
#2
Posté 05 avril 2011 - 10:26
dont know what is cr/lf but you can get newline via "\\n"
#3
Posté 05 avril 2011 - 03:04
cr/lf = carriage return / line feed
the former being a throwback to ancient times when people used TYPEWRITERS and had to use the carriage return bar to shove the carriage back to the beginning of the next line of text (advancing one line and moving to left of that line).
GM_ODA is a fossil and remembers these things. lol
the former being a throwback to ancient times when people used TYPEWRITERS and had to use the carriage return bar to shove the carriage back to the beginning of the next line of text (advancing one line and moving to left of that line).
GM_ODA is a fossil and remembers these things. lol
#4
Posté 06 avril 2011 - 07:51
and you want a carage return for what? some limits the toolset has is no subscripted variables ie:
string sStringname1="name"
string sStringname2="a"
string sStringname3="b"
for x= 1 to 3
?=print sStringname(x) rem from basic, a quick example
next x
result would be :
name
a
b
so I dont think you can do the carage return, because there realy is no practle use since text display doesnt seem to be vary important in the game. But I could be wrong.
I my self come from old programing and I would find it useful in displaying text, I would also find subscripted variables useful.
the most you seem to be able to do is:
object oPlayer;
string szMessage;
string sString="some string";
int nCnt
for (nCnt=1;nCnt >3;nCnt++)
{
szMessage=sString+IntToString;
SendMessageToPC( oPlayer, szMessage)
}
so you should get message:
some string1
some string2
some string3
those are just some of the limits there are more.
I hope i answered your question, I like to know what you find out.
string sStringname1="name"
string sStringname2="a"
string sStringname3="b"
for x= 1 to 3
?=print sStringname(x) rem from basic, a quick example
next x
result would be :
name
a
b
so I dont think you can do the carage return, because there realy is no practle use since text display doesnt seem to be vary important in the game. But I could be wrong.
I my self come from old programing and I would find it useful in displaying text, I would also find subscripted variables useful.
the most you seem to be able to do is:
object oPlayer;
string szMessage;
string sString="some string";
int nCnt
for (nCnt=1;nCnt >3;nCnt++)
{
szMessage=sString+IntToString;
SendMessageToPC( oPlayer, szMessage)
}
so you should get message:
some string1
some string2
some string3
those are just some of the limits there are more.
I hope i answered your question, I like to know what you find out.
#5
Posté 06 avril 2011 - 11:33
The purpose of the cr/lf is the same as our computers' '\\n' as noted by Shadow above, it ends the line and begins a new one (formatting).
#6
Posté 06 avril 2011 - 08:13
ok thats great to know I did not know \\n did that thanyou Shadow/ehye
#7
Posté 08 avril 2011 - 02:37
Thanks guys. Just I couldn't find about this anywhere I looked. I need this since I have an idea for something that I'll keep under wraps until I release it. Suffice to say that it has to do with the fact that you can set the description for objects programmatically (since 1.69) I think.
TR
TR
#8
Posté 08 avril 2011 - 06:33
Just a heads up Tarot. If you plan on doing this via the OnPlayerChat the "\\n" doesn't work the same way. You have to replace it with itself using the StringReplace function.
I had to figure this out over in the NWN2 fourms: social.bioware.com/forum/1/topic/164/index/6732633
I had to figure this out over in the NWN2 fourms: social.bioware.com/forum/1/topic/164/index/6732633
Modifié par GhostOfGod, 08 avril 2011 - 06:34 .
#9
Posté 08 avril 2011 - 08:50
If the \\n does not work for you correctly in some spots, You could alway just grab a carrage return out of the Dialog.tlk file.
string sLineFeed =GetSubString(GetStringByStrRef(54),37,1);
Should work, That is if I didn't miss count where the line feed was at.
string sLineFeed =GetSubString(GetStringByStrRef(54),37,1);
Should work, That is if I didn't miss count where the line feed was at.
#10
Posté 12 avril 2011 - 09:30
Thanks GhostOfGod and Lightfoot8 both pieces are well worth knowing. I have now got what I had planned, working and if I'd known just how much work it was going to take and how much it would make the mod grow, I wouldn't have started on this particular idea. I suppose I'll feel good when I've actually finished this "little" idea.
TR
TR





Retour en haut







