dwie zmienne w jednej linii 10229 25

O temacie

Autor karus

Zaczęty 9.12.2011 roku

Wyświetleń 10229

Odpowiedzi 25

karus

karus

Użytkownicy
posty122
  • Użytkownicy

karus

dwie zmienne w jednej linii
#20 2011-12-09, 22:05(Ostatnia zmiana: 2011-12-09, 22:07)
Cytuj
A kiedy przypisujesz jakąś wartość zmiennym x i xn? Kiedy wywołujesz tą funkcję: DIA_Questob_ST_Wybor1_1_1?
instance  DIA_Questob_ST (C_INFO)
{
npc = NOV_2060_Questob;
nr = 1;
condition = DIA_Questob_ST_Condition;
information = DIA_Questob_ST_Info;
permanent = 1;
important = 0;
description = "Chcę Pisać";
};

FUNC int  DIA_Questob_ST_Condition()
{  
return 1;

};


FUNC VOID DIA_Questob_ST_Info()
{
AI_Output (other, self,"DIA_Questob_ST_15_00"); //Chcę pisać.

Info_ClearChoices (DIA_Questob_ST);
Info_AddChoice (DIA_Questob_ST,"Wezmę to pióro i księgę",DIA_Questob_ST_Wybor1);
};

FUNC VOID DIA_Questob_ST_Wybor1 ()
{
Info_ClearChoices (DIA_Questob_ST);
Info_AddChoice (DIA_Questob_ST, "[PISZ]",DIA_Questob_ST_Wybor1_1);
};

func void DIA_Questob_ST_Wybor1_1()
{
Info_ClearChoices (DIA_Questob_ST);
Info_AddChoice (DIA_Questob_ST, "A",DIA_Questob_ST_Wybor1_1_1);
Info_AddChoice (DIA_Questob_ST, "B",DIA_Questob_ST_Wybor3_1);
Info_AddChoice (DIA_Questob_ST, "C",DIA_Questob_ST_Wybor3_4);
Info_AddChoice (DIA_Questob_ST, "D",DIA_Questob_ST_Wybor3_5);
Info_AddChoice (DIA_Questob_ST, DIALOG_BACK,DIA_Questob_ST_Wybor1_1_2);
};

func void DIA_Questob_ST_Wybor1_1_1()
{
x = ConcatStrings(x, "A");
};

func void DIA_Questob_ST_Wybor3_1()
{
xn = ConcatStrings(xn, "B");
};

func void DIA_Questob_ST_Wybor3_4 ()
{
        xnm = ConcatStrings(xnm, "C");
};

func void DIA_Questob_ST_Wybor3_5 ()
{
        xnx = ConcatStrings(xnx, "D");
};

func void DIA_Questob_ST_Wybor1_1_2()
{
Info_ClearChoices (DIA_Questob_ST);
};

plik z księgą

FUNC VOID UseCzystaKsiega()
{
   a = ConcatStrings(x, " ");
        tab = ConcatStrings(a, xn);



var int nDocID;

nDocID = Doc_Create ()  ; // DocManager
Doc_SetPages ( nDocID,  2 );                         //wieviel Pages

Doc_SetPage ( nDocID,  0, "Book_Mage_L.tga", 0 );
Doc_SetPage ( nDocID,  1, "Book_Mage_R.tga", 0 );

//1.Seite
 
  Doc_SetFont ( nDocID, -1, "font_15_book.tga"   ); // -1 -> all pages
  Doc_PrintLine ( nDocID,  0, "");
  Doc_PrintLine ( nDocID,  0, "");
Doc_SetMargins ( nDocID,  0,  275, 20, 30, 20, 1   );  //  0 -> margins are in pixels
Doc_PrintLine ( nDocID,  0, " " );
Doc_SetFont ( nDocID, -1, "font_10_book.TGA"   ); // -1 -> all pages
Doc_PrintLine ( nDocID,  0,  "");
Doc_PrintLine ( nDocID,  0, "");
Doc_PrintLines ( nDocID,  1, tab ); Doc_PrintLines  ( nDocID,  0, tab);
Doc_PrintLines ( nDocID,  0, "");
//2.Seite
Doc_SetMargins ( nDocID, -1, 30, 20, 275, 20, 1   );  //  0 -> margins are in pixels (Position des Textes von den Ränder des TGAs aus, links,oben,rechts,unten)
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLines ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_Show ( nDocID );

};

No więc wyświetla się A,B obok siebie, natomiast zadeklarowałem C i D, ale są pod sobą.

Tak wyglądał func_void księgi przed chwilą

FUNC VOID UseCzystaKsiega()
{
   a = ConcatStrings(x, " ");
        tab = ConcatStrings(a, xn);
c = ConcatStrings (xnm, " ");
tab1 = ConcatStrings (c, xnx);

Tak księga




var int nDocID;

nDocID = Doc_Create ()  ; // DocManager
Doc_SetPages ( nDocID,  2 );                         //wieviel Pages

Doc_SetPage ( nDocID,  0, "Book_Mage_L.tga", 0 );
Doc_SetPage ( nDocID,  1, "Book_Mage_R.tga", 0 );

//1.Seite
 
  Doc_SetFont ( nDocID, -1, "font_15_book.tga"   ); // -1 -> all pages
  Doc_PrintLine ( nDocID,  0, "");
  Doc_PrintLine ( nDocID,  0, "");
Doc_SetMargins ( nDocID,  0,  275, 20, 30, 20, 1   );  //  0 -> margins are in pixels
Doc_PrintLine ( nDocID,  0, " " );
Doc_SetFont ( nDocID, -1, "font_10_book.TGA"   ); // -1 -> all pages
Doc_PrintLine ( nDocID,  0,  "");
Doc_PrintLine ( nDocID,  0, "");
Doc_PrintLines ( nDocID,  1, tab ); Doc_PrintLines  ( nDocID,  0, tab);  Doc_PrintLines  ( nDocID,  0, tab1);  Doc_PrintLines  ( nDocID,  0, tab1);
Doc_PrintLines ( nDocID,  0, "");
//2.Seite
Doc_SetMargins ( nDocID, -1, 30, 20, 275, 20, 1   );  //  0 -> margins are in pixels (Position des Textes von den Ränder des TGAs aus, links,oben,rechts,unten)
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLines ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_PrintLine ( nDocID,  1, "");
Doc_Show ( nDocID );

};

story.globals

var string a;
var string c;
var string x;
var string xn;
var string xnm;
var string xnx;
var string tab;
var string tab1;
 

Shothic

Shothic

Użytkownicy
posty38
Propsy17
  • Użytkownicy
Robisz tak:
func void DIA_Questob_ST_Wybor1_1_1()
{
        a = ConcatStrings(a, "A");
};

func void DIA_Questob_ST_Wybor3_1()
{
        a = ConcatStrings(a, "B");
};

func void DIA_Questob_ST_Wybor3_4 ()
{
       a = ConcatStrings(a, "C");
};

func void DIA_Questob_ST_Wybor3_5 ()
{
        a = ConcatStrings(a, "D");
};

func void DIA_Questob_ST_Wybor1_1_2()
{
        Info_ClearChoices       (DIA_Questob_ST);
};

FUNC VOID UseCzystaKsiega()
        {
        tab = ConcatStrings(tab, a);
        var int nDocID;
                nDocID =        Doc_Create              ()                        ;                                                             // DocManager
                                        Doc_SetPages    ( nDocID,  2 );                         //wieviel Pages

                                        Doc_SetPage     ( nDocID,  0, "Book_Mage_L.tga",        0               );
                                        Doc_SetPage     ( nDocID,  1, "Book_Mage_R.tga",        0               );
                                       
                                        //1.Seite
                                       
                                        Doc_SetFont     ( nDocID, -1, "font_15_book.tga"                                );      // -1 -> all pages
                                        Doc_PrintLine   ( nDocID,  0, "");
                                        Doc_PrintLine   ( nDocID,  0, "");
                                        Doc_SetMargins  ( nDocID,  0,  275, 20, 30, 20, 1               );  //  0 -> margins are in pixels
                                        Doc_PrintLine   ( nDocID,  0, " "                       );
                                        Doc_SetFont     ( nDocID, -1, "font_10_book.TGA"                                );      // -1 -> all pages
                                        Doc_PrintLine   ( nDocID,  0,  "");
                                        Doc_PrintLine   ( nDocID,  0, "");
                                        Doc_PrintLines  ( nDocID,  0, tab);
                                        Doc_PrintLines  ( nDocID,  0, "");
                                        //2.Seite
                                        Doc_SetMargins  ( nDocID, -1, 30, 20, 275, 20, 1                );  //  0 -> margins are in pixels (Position des Textes von den Ränder des TGAs aus, links,oben,rechts,unten)
                                        Doc_PrintLine   ( nDocID,  1,"");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLines  ( nDocID,  1, "");      
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_Show                ( nDocID );
                                       
        };

o to ci chodziło?
 

karus

karus

Użytkownicy
posty122
  • Użytkownicy

karus

dwie zmienne w jednej linii
#22 2011-12-09, 22:34(Ostatnia zmiana: 2011-12-09, 22:52)
Ok zrobiłem tak, dwie zmienne zadeklarowałem var string tab; oraz var string a; , zrobiłem paczkę z modem i nie ma liter po wybraniu którekolwiek z nich. :pokerface:  Tobie to działa? Księgę respawnuje z konsoli, może trzeba ją dać bohaterowi zaraz przed wyborem liter, jeśli ma to jakiekolwiek znaczenie?

EDIT

FUNC VOID UseCzystaKsiega()
        {
        tab = ConcatStrings(tab, a);
        var int nDocID;
                nDocID =        Doc_Create              ()                        ;                                                             // DocManager
                                        Doc_SetPages    ( nDocID,  2 );                         //wieviel Pages

                                        Doc_SetPage     ( nDocID,  0, "Book_Mage_L.tga",        0               );
                                        Doc_SetPage     ( nDocID,  1, "Book_Mage_R.tga",        0               );
                                       
                                        //1.Seite
                                       
                                        Doc_SetFont     ( nDocID, -1, "font_15_book.tga"                                );      // -1 -> all pages
                                        Doc_PrintLine   ( nDocID,  0, "");
                                        Doc_PrintLine   ( nDocID,  0, "");
                                        Doc_SetMargins  ( nDocID,  0,  275, 20, 30, 20, 1               );  //  0 -> margins are in pixels
                                        Doc_PrintLine   ( nDocID,  0, " "                       );
                                        Doc_SetFont     ( nDocID, -1, "font_10_book.TGA"                                );      // -1 -> all pages
                                        Doc_PrintLine   ( nDocID,  0,  "");
                                        Doc_PrintLine   ( nDocID,  0, "");
                                        Doc_PrintLines  ( nDocID,  1, tab);  Doc_PrintLines  ( nDocID,  0, tab);
                                        Doc_PrintLines  ( nDocID,  0, "");
                                        //2.Seite
                                        Doc_SetMargins  ( nDocID, -1, 30, 20, 275, 20, 1                );  //  0 -> margins are in pixels (Position des Textes von den Ränder des TGAs aus, links,oben,rechts,unten)
                                        Doc_PrintLine   ( nDocID,  1,"");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLines  ( nDocID,  1, "");      
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_PrintLine   ( nDocID,  1, "");
                                        Doc_Show                ( nDocID );
                                       
        };

Zrobiłem coś takiego i tak: Klikam "A" jest A, klikam "B" dodaje "AB" i jest w sumie AAB, klikam C jest "ABC" i mam stworka AABABC, klikam D jest stonoga AABABCAABCD i wyłazi poza książkę.  :lol:  Już blisko  :ok:
 

RafalBudzis

RafalBudzis

Użytkownicy
posty1967
Propsy808
ProfesjaSkrypter
  • Użytkownicy
A usuń to na chwile

tab = ConcatStrings(tab, a);

Shothic

Shothic

Użytkownicy
posty38
Propsy17
  • Użytkownicy
 

karus

karus

Użytkownicy
posty122
  • Użytkownicy
DZIAŁA! :ok:  :lol:
 


0 użytkowników i 1 Gość przegląda ten wątek.
0 użytkowników
Do góry