Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - ShinjinNakamura

#1
Quote from: Crimson Wizard on Sat 12/04/2014 17:17:20
That's not a good idea, you might get a lot of problems because of this, not just with "skip speech", and might end writing custom speech system.
What exactly was a problem with custom font?

Well basically Korean fonts have 2000+ characters (because each character is combined with others to form new characters e.g http://cl.ly/image/1b0r2g1M1q0C) so that's kind of impossible to bring down to 256 without losing a majority of necessary characters. :\
#2
So that idea didn't really work out well.

So what I'm doing now is using images instead of text for dialogue. This works fine but since I can't use SetSkipSpeech by click, any idea on how to accomplish this with images?
#3
Good idea, I'll have to use a program to make a custom font set. Hopefully it will work.
#4
I'm currently translating my game from English to Korean. However I can't add Korean text in the game script files, they end up appearing as question marks as well as in the rendered game.

How do I go about this?
#5
All points taken into account, thanks  guys.
#6
Salam,
I applied the following script to have my cursor change from walk icon to interact icon on mouse over. Thing is it works fine for characters, but when I apply to objects it just doesn't work.
Code: AGS

function room_RepExec()
{
if (Object.GetAtScreenXY(mouse.x, mouse.y) == oPaper)
{
Mouse.Mode = eModeInteract;
}
else Mouse.Mode = eModeWalkto;

This was added under room script.
#7
It worked, thanks.
#8
Salam,
I intended to use a global variable to make multiple dialogs on a single character.
I defined the variable in the interface (BoramTalk, with starting value 1), and wrote this code:
----------------------------------------------------------------------------
Code: AGS

function cBoram_Talk()
{
cHyomin.FaceCharacter(cBoram);
cHyomin.LockView (VIEW3);
cHyomin.Animate(0, 1, eOnce, eNoBlock, eForwards);
SetSkipSpeech(3);
cHyomin.Say ("Boram! What are you doing?!");
cBoram.Say("Eating cake!");
cHyomin.Say("How did you get IN the cake though?!");
cBoram.Say("A story better left untold.");
cHyomin.Say("If you say so...");
cHyomin.UnlockView();
cHyomin.Say("Enjoy your cake then I guess!");
cBoram.Say("Wait! Help me eat it all so I can get out!");
cBoram.Say("The boss will kill me if he finds out I went against my diet!");
cHyomin.Say("I can't eat all that!");
cBoram.Say("Well get the others here and help me then!");
cHyomin.Say("Ok...");
BoramTalk += 1;
}

if (BoramTalk == 2)
{
{cBoram_Talk() = false}
{
function  cBoram_Talk2()
{cBoram.Say ("Nom Nom");
}
}
}

-----------------------------------------------------------------
When the character Boram is clicked on once, the function cBoram_Talk runs.
With it I added the line BoramTalk += 1;
With this the variable value should go up to 2.
And going on to the if statement: it makes cBoram_Talk false and initiates cBoram_Talk2

The problem for me is this[ GlobalScript.asc(78): Error (line 78): Parse error: unexpected 'if']

Also I tried putting this dialog in the room script (because the character stays in the same room), but it doesn't initiate then.

#9
Text appears fine, the image on which its supposed to render doesn't appear (the bubble). Tried changing option text color too, and checked if x/y coordinates were correct, still no change.
This is my script.
------------------------------------------------------------------------
Code: ags

function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
  info.X = 300;
  info.Y = 300;
  info.Width = 245;
  info.Height = 561;
}
function dialog_options_render(DialogOptionsRenderingInfo *info)
{
  info.Surface.Clear(COLOR_TRANSPARENT);    // Clear the area transparent
  info.Surface.DrawImage(0, 0, 25);    // Draws your cloud sprite behind the custom dialog render
  
  int i = 1,  ypos = 0;
  while (i <= info.DialogToRender.OptionCount)    // Render all the options that are enabled
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
      if (info.ActiveOptionID == i) info.Surface.DrawingColor = 13;
      else info.Surface.DrawingColor = 4;
      info.Surface.DrawStringWrapped(5, ypos, info.Width - 10, eFontFont0, eAlignLeft, info.DialogToRender.GetOptionText(i));
      ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontFont0, info.Width - 10);
    }
    i++;
  }
}

---------------------------------------------------------------
The sprite ID is 25 because Iam using a non alpha channel image. Oh and I placed this under the global script.
Here is an image of the scene, as you can see only the text appears above the head.
Scene Image
#10
Aaah, Iam a little more clear on the script now.

Yes Iam afraid the image Iam using is alpha channel. So I would have to do it via GUI.
(By the way I tried the whole new script on a non alpha channel image. Unfortunately it didn't work.)
#11
Sprite No. 13 is a text bubble (non-dynamic). I tried to use it as a background image for the custom GUI I intended to use for dialog.
But like I said, under general settings the [Use GUI for dialog options] was not working.

As far as the script is concerned, in DrawImage:
surface.DrawImage (100, 100, oDoor.Graphic, 40);
where oDoor.Graphic is placed, how do I signify an object as a graphic? I assumed any object/picture/character we use always takes the form of a sprite.
#12
Salam,

I've checked the [Use GUI for dialog options] under general settings by inputting 1 (because the ID for the custom made gui I want to use is 1),
and made sure under the gui options to enable (PopupYPos). When I run the game, it doesn't appear.

I even tried enabling [Custom Text-Window GUI] under general settings by inputting 1. Still doesn't appear.
By the way Iam using lucasart style.

So I thought I would go script my own, using the manual's example as a template.
---------------------------------------------------------------------
Code: ags

function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
  info.X = 335;
  info.Y = 312;
  info.Width = 200;
  info.Height = 600;
}

function dialog_options_render(DialogOptionsRenderingInfo *info)
{
DrawingSurface.DrawImage(335,  312, 13)};
}

--------------------------------------------------------------------------
Problem here is that when inputting the SpriteSlot number, the one I want to use is no. 13, the following error message appears:
GlobalScript.asc(12): Error (line 12): must have an instance of the struct to access a non-static member

If I could use the former easier method, that would be great. But I don't mind the latter scripting method either.

Please kindly help,
Thanks in Advance.
#13
Thanks for the explanation Khris, but I got Ryan's code to work.

From what I understand, the "move" action will only occur so long as the the NPC is not walking (ref to !cBoram.Moving).
In this case my NPC does not walk, and so the y coordinate movement is executed. All this without affecting my main character movement (which was my main concern.)

Thanks a lot again guys. This problem is officially solved.
#14
Oh no. Although my NPC is moving repeatedly like I want it, but now my main character does not respond immediately.
Iam using eBlock style, but when I use eNoBlock, although my main character moves but my NPC stands still then.
Here is my code:
-------------------------------------------------------
Code: ags

function room_AfterFadeIn()
{
cBoram.y=370;
}

function room_RepExec()
{
cBoram.Move(705, 380, eBlock, eAnywhere);
if (cBoram.y==380) cBoram.Move(705, 370, eBlock, eAnywhere);
}

---------------------------------------------------------------
Does this have something to do with what Khris was saying about the room script?
#15
Aah, I see. Both have to be linked. That solves the problem, thanks.

Oh wait, one more thing. Can multiple script functions fall under the same event list.
As in for "repeatedly execute", could I link it to two things in the script?
#16
Unfortunately when I run the code now, the following error message appears:
____________________________________________________________________________
An internal error has occured, please note down the following information. If the problem still persists, post the details on the AGS Technical Forums. (ACI version 3.21.1115)

Error: prepare_script_error: error -18 (no such function in script) trying to run 'room_RepExec' (Room 1)
_____________________________________________________________________________
I wanted to post this in technical forum, but I assumed there was a mistake in the script itself.
Is there something I should add to the global script too?
#17
Salam,

Iam trying to move an NPC up and down in the background in a constant loop, and have applied the following code in the room script file:
-----------------------------------------------------
Code: ags

// room script file
function room_load()
{
cBoram.y=370;
}

function repeatedly_execute() 
{
cBoram.y+=1;
if (cBoram.y=380) cBoram.y=370;
}

-----------------------------------------------------
Everytime I run it, the following error message appears:
_____________________________________________________
Failed to save room room1.crm; details below
room1.asc(10): Error (line 10): Parse error in expr near 'cBoram'
______________________________________________________
line 10 is  the last one with "if"
c.Boram is the NPC


SMF spam blocked by CleanTalk