Story System

STORY SYSTEM for OpenBoR 2.1

No permission to download
i've made some tests with this story mode system, and i can say it's a very powerful tool for making the texts in a very easy way! very impressive, CRxTRDude!

i've a question:
there is a way to make appear the messages one letter at time very quick? i don't know if i've made myself clear, but, you know, like all classic games of the 90'.
 
Thanks for testing it. Glad that you like the system so far.

To be honest, I really don't know how to do such. It could be done though, tampering the dialog display script.
 
How can change the fonts in the Story Mode sript?
And how can change the size of the rectangle behind the dialogs?
 
dantedevil said:

Sorry if I posted only just now Dante, but here's how you manipulate the dialog text to change their fonts, make sure of course that you have your replacement font ready in any slot you choose.

- Search this comment in story.c:

Code:
//Draw Text For Dialog *

There are three sets of settextobjects in there. You can manipulate them yourself, but here's the syntax:

   
Code:
settextobj(index, x, y, font, z, text, time)

You can't find this in the DCEmulation manual, but you can find it on the wiki.

You will need two fonts for this one. One for the heading (first settextobject) and another one for the body of the text (the final two settextobjects).

For the scrolling text, I think I explained it in the readme for the story system:

   
Code:
{message} {font} {x}

Just go to the text that you have for that scene with scrolling text and add the font parameter.

For example:

Code:
AWESOME_DUDE! 4

Displays "AWESOME DUDE!" using font 4.

I guess that's what I can say so far.
 
Thanks my friend!

But still don't know how can change the size and color of the rectangle behind the dialogs.
 
What did you do? I did forgot to tell you about the story system's border thing, but you actually found it yourself. The only thing I would say is that you know that there are two colors (one for images on the left and one on the opposite) that you need to manipulate right?

Also as well, you need to know that the rectangular border is calculated like this:

frame_x = res_x*0.2;
frame_y = res_y*0.73;
frame_w = res_x - ((frame_x*2)-1);
frame_h = 60;

Assume res_x and res_y is the width and height resolution of the mod respectively.

This is for any resolution. There is a version for 4:3 aspect ratios (which nowadays is not common), but don't touch it, it's got enough legroom to put all text here. on mods with that size.

You can find this one if you search this comment:
//Define the frame

I commented everything anyway to make it easy to navigate. I encountered that while managing the source for OpenBOR along with checking other codes.
 
Yes, I find it comparing the story.c of the BAD ASS BABES demo with my story. c.
Because that demo have different size and colors in the rectangle behind the dialogs, to the colors ans size of my story. c.

Thanks my friend!
 
Hello CRxTRDude!
I find some problems with dialogs in deaths enemies.
I open a thread about this:
http://www.chronocrash.com/forum/index.php?topic=2477.msg33842;topicseen#new
But now I think, here is the right place.
Because this problem can affect everyone use the story system.
Seems the onkillscript can't work if the enemy has set NODIEBLINK 3 in one of his deaths animations.
I change all NODIEBLINK 3 for 2 and now works ok.
Here the new problem,  the onkillscript work only with nornal enemies.
I mean, If the enemy it's a boss not work.

spawn balrog
boss 1
coords 490 240
at 1500

So ca be possibble spawn the dialogs in the last frame of the death animation?
 
Yes my friend, I see how used you.
But with your method I can't set enemies reinforcements to come help the boss.
I use the classic style,  after spawn the boss I set a lots of enemies to come, always depending the group number limit.
If I use your merhod, only can set enemies before the boss,  then finally the boss fight alone. I dont want that.
Thanks anyway.
 
A new contribution for this system,

In this link you can find a script to add a dialog during any animation tou want:

http://www.chronocrash.com/forum/index.php?topic=2544.msg34816#msg34816

So this way you no need depend of onspawnscript or onkillscript.

Yoo can spawn and enemy and on the last frame of the ANIM SPAWN you can spawn the dialog, this looks much better.

Or you can spawn the dialog after the normal death, but if you make the fatality tho the enemy the dialog never shows.
This have a  lot of utilities.
This was my idea but never be possible without the help of Piccolo.
Thanks to all make this posible.
Enjoy!
 
I have a suggestion:
Is it possible to add Live2D support in your program? I have some sprites that are meant for it, but I don't want to assemble the sprites manually.

Video Example
 
Live2D, or specifically Cubism, is an API, so you will need to do some appropriate changes over the software level that the script couldn't do.

You're better off with static-ized version of the Neptunia portraits, that means assembling all the required sprites into a single image, which I know you don't like to do.

If you want, you can have someone else do it for you or you can do screen shots of the original sprites and then assemble them yourself using layers, matching the sprites there (if I were to do it, that's what would I do)
 
Yeah, you remember what I said the last time that I wanted an animated version. But White Dragon's TMNT and Die_In_Fire's Double Dragon mods beat it for showing the text scrolling and avatars/portraits. Someday I will ask WD about the animated ones since he did it for his TMNT where one of the Turtles shows his animated death icon.
 
You only did say that is there a way for a different portrait to be used, not an animated portrait. Although it could be possible using animated gifs to give a sense of animation, what Sammy was proposing was the use of a external API to animate a 2d image into a model (Which is what Cubism is all about).

Yeah, I might not be up to the challenge just yet, you just have to wait for people like WD for animated stuff. Although you cannot use Cubism, you can just animate your portraits, probably similar to pheonix wright or something into a gif or in fact combine the animated title tutorial that I did a while back (it's still in the wiki) and combine it with that, but again, my priorities are different now and I might not be up to the task.
 
Take a look at updated.c in the scripts folder and look inside. It's right here in bold under mainLoop function.

#include "data/scripts/common/constants.h"
#include "data/scripts/story/story_define.h"
#include "data/scripts/story.c"
#include "data/scripts/gettick.c"

void main()
{
mainLoop();
}

void mainLoop()
{
if(SYS_INLEVEL)
{
inLevelLoop();
}
else if(SYS_INMENU || SYS_INTITLE){
drawstring(110,40,3,"Story System EdItIon");
drawstring(124,212,0,"CRxTRDude 2014");
}
}

void inLevelLoop()
{
turnWhite();
story();
}

void pause()
{
if(getindexedvar(PAUSE))return;
spawnEnt("pause",0,0);
setindexedvar(PAUSE,1);
}

void spawnEnt(void vName,void x,void z)
{
clearspawnentry();
setspawnentry("name", vName);
void ent=spawn();
changeentityproperty(ent,"position",x+openborvariant("xpos"),z+openborvariant("ypos"));
}

void turnWhite()
{
void dir=getindexedvar(WHITE);

if(!dir){return;}else{}

void tick=get_tick();
void w=getglobalvar("white.alpha");
if(!w)
{
if(dir==1)
{
w=0;
}else{
w=256;
}
}

if(dir==1)
{
w+=tick*0.8;
}else{
w-=tick*0.8;
}

if(dir==1)
{
if(w>255)w=255;
}else{
if(w<0)w=0;
}
setglobalvar("white.alpha",w);
drawbox(0,0,480,272,900,rgbcolor(w,w,w),1);
}

In case you don't understand what it is, drawstring has its parameters of axis/position, font type number, and text. Text always has to be in quotations like the example above. Also, for font type, take a look in the sprites folder that includes fonts. (0 = font1.gif/font1.png; 1 = font2.gif/font2.png, etc.)

drawstring

drawstring(int x, int y, int font#, text)

~Draw the text in (x, y) of the screen, with font specified.
~This method is costy, because each character is a sprite. And to prevent blinking, have to put this function in an update script (a script that runs each game loop).
 
Damn, beat me to it. I was about to say that. Yeah, it's in the updated.c (That was like almost many months ago, my memory served me well apparently ...)

@maxman, I think he knows what that is. it's just that he didn't know where the text is rendered.
 
My scripting is a bit rusty unfortunately. Right now, I can only think of some ideas.

One thing is to add some sort of timer. We already had some get tick function, we could put a little timer function that clocks out, say 2 seconds, and then using this, we could delay the story keys function. If the timer is now >= 2 seconds, then we could enable the use of the keys. The key script is compartmentalized after all (see story/story_keys.c), so you could just add the timer script to it.

Since I'm a bit rusty on that, you could ask someone else to do something like that, I think WD could help you with that.

Another way is to really improve the scripts, adding a typewritten text, this would truly be similar to a visual novel.

But I'm way out of my league for this one, for now ...
 
Back
Top Bottom