Help with Dialogue

theoz

New member
I am currently doing dialogue through scenes, these can not escape. I need to make dialog via escript (they let it out) just like Rocket viper 2, but I can not get it to work, no matter how hard I try. Some help?

This is how I made
Code:
name		non2
type		text
facing		1
setlayer 	10000000


anim idle
        loop 0
        offset	0 -3

# COM
delay	29
frame	data/scenes/dial/non/empty2.gif
frame	data/scenes/dial/non/empty2.gif
      frame	data/scenes/dial/non/5.gif
      frame	data/scenes/dial/non/5.gif
      frame	data/scenes/dial/non/5.gif
 
When I put in my game, give the follow mensage:

Code:
There's an exception while executing script 'updated'
:-\

I THINK...There is one thing I can do. I CAN make a scene (dialogue) before starting the stage  Or at the end...So cut pressing button  :D But in the middle of stage there is no way :-[....So Scenes you not work to me too. :'(

There is another way to I SKIP from dialogue texts? This think that would be so simple (skip from text), is too complex...  :-[
 
@ Theoz: let me confirm this, do you want to make dialogues using Volcanic's code OR with simple text type entities?

If the former, then you need to modify the scripts to allow skipping the whole dialogue. If the latter, you can script dialogue skip yourself :)
 
msmalik681 said:
If your text entity has not got "noskip 1" in header then it should skip by pressing attack.

Yes, but I can not skip Fast >> :-[

Bloodbane said:
@ Theoz: let me confirm this, do you want to make dialogues using Volcanic's code OR with simple text type entities?

If the former, then you need to modify the scripts to allow skipping the whole dialogue. If the latter, you can script dialogue skip yourself :)

Volcanicic's code would be great, but always bug when I Try. (maybe because I am STILL too noob in scripts area :P) So, I made the simple text entities (like you could test in my demo).

How can I script dialogue to skip like you said? Do you have the code? Thanks :D

 
Well, it turns out it's less simple but it's not hard to comprehend anyways :)

First you need to create this keyall.c in data/scripts folder:
Code:
void main()
{   int iPlIndex = getlocalvar("player"); //Get Player's index
    void vSelf = getlocalvar("self"); //Get player
    void vAniID = getentityproperty(vSelf,"animationID"); //Get current animation ID
    void vAniPos = getentityproperty(vSelf, "animpos"); //Get current animation frame

    void iUp = playerkeys(iPlIndex, 1, "moveup"); // New key status of "Up"
    void iDown = playerkeys(iPlIndex, 1, "movedown"); // New key status of "Down"
    void iLeft = playerkeys(iPlIndex, 1, "moveleft"); // New key status of "Left"
    void iRight = playerkeys(iPlIndex, 1, "moveright"); // New key status of "Right"
    void iAttack = playerkeys(iPlIndex, 1, "attack");// New key status of "Attack"
    void iSpecial = playerkeys(iPlIndex, 1, "special");// New key status of "Special"
    void iJump = playerkeys(iPlIndex, 1, "jump");// New key status of "Jump"

    void iUpR = playerkeys(iPlIndex, 2, "moveup"); // Release status of "Up"
    void iDownR = playerkeys(iPlIndex, 2, "movedown"); // Release status of "Down"
    void iLeftR = playerkeys(iPlIndex, 2, "moveleft"); // Release status of "Left"
    void iRightR = playerkeys(iPlIndex, 2, "moveright"); // Release status of "Right"
    void iAttackR = playerkeys(iPlIndex, 2, "attack");// Release status of "Attack"
    void iJumpR = playerkeys(iPlIndex, 2, "jump");// Release status of "Jump"

    void iUpH = playerkeys(iPlIndex, 0, "moveup"); // Held key status of "Up"
    void iDownH = playerkeys(iPlIndex, 0, "movedown"); // Held key status of "Down"
    void iLeftH = playerkeys(iPlIndex, 0, "moveleft"); // Held key status of "Left"
    void iRightH = playerkeys(iPlIndex, 0, "moveright"); // Held key status of "Right"

// Movement event capture
    if(iLeft){ //Left is pressed?
      setglobalvar(iPlIndex+"X", -1);
    } else if(iRight){ //Right is pressed?
      setglobalvar(iPlIndex+"X", 1);
    }
    if(iUp){ //Up is pressed?
      setglobalvar(iPlIndex+"Y", 1);
    } else if(iDown){ //Down is pressed?
      setglobalvar(iPlIndex+"Y", -1);
    }

    if(iLeftR || iRightR){ //Left or Right is released?
      setglobalvar(iPlIndex+"X", 0);
    }
    if(iUpR || iDownR){ //Up or Down is released?
      setglobalvar(iPlIndex+"Y", 0);
    }

// Action event capture
    if(iAttack){ //Attack is pressed?
      setglobalvar(iPlIndex+"A", 1);
    }
    if(iAttackR){ //Attack is released?
      setglobalvar(iPlIndex+"A", NULL());
    }
    if(iJump){ //Jump is pressed?
      setglobalvar(iPlIndex+"J", 1);
    }
    if(iJumpR){ //Jump is released?
      setglobalvar(iPlIndex+"J", NULL());
    }
}

I'll spare the explanation for now but I can tell that this script will capture keypress and release event and store it in certain global variable

Then in the dialogue text add this script:
anim idle
@script
  if(frame<=10){
    void self = getlocalvar("self");
    int J1 = getglobalvar("0J");
    int J2 = getglobalvar("1J");

    if(J1 || J2){
      updateframe(self, 11); //Jumps to 12th frame
    }
  }
@end_script
...

Normally, this dialogue can only be skipped page per page with pressing attack button, however by adding this script, pressing jump button will skip to 12th frame
Of course, you can modify the values to suit your dialogue :)

HTH
 
Back
Top Bottom