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 - Sephiroth

#21
What the hell happened to your ant game? It looked pretty good and seemed to be almost completed...

#22
I've been able to play and finish the game, I don't mind the forced fullscreen on my laptop but as others mentioned it would be nice to have the setup file and the game in one Zip download.

The game was short and simple, I haven't encountered any bug and every interaction I tried had a proper answer. I just didn't like the default dialog box, transparent-over-the-head text would have been nice.
The graphics are pretty good considering Masahiro and Moeka, 11 and 5 years old, are the artists.
I liked the whole vision of the adventure, it reminded me of how I used to play when I was a kid, as a father I also enjoyed the 'twist'.

I was intrigued by your choice to involve kids in game making and wanted to say congratulations for the release!
#23
Snarky: You'd be right if the module allowed you to actually interrupt its background queue, remember what sentence it was saying and resume the queue. Which is not possible, AFAIK. Implementing it yourself is therefore the only solution, besides I think 30 lines of code is rather good compared to using a whole module, especially when he only needs it for a precise scene and not as a general speech mechanic.
QuoteI'm a little puzzled by your attitude to just give up when you come across some minor problem with a solution
How cold, the thing he's trying to achieve can't be done with the module he's using, and I'm sure you can tell (from his code) he doesn't know enough to find out a workaround by himself.

Tenacious Stu: If you want to make it easier by using a module, then you could choose the BGSpeech module, and replace the calls to saybackground by the module SayInBackground, this would make speech/talking animation available with saybackground.

Monkey_05_06's QueuedSpeech Module is the closest to what you're looking for, it is pretty hard to make it work exactly like you want, but it may be possible, as Snarky mentionned.

static void QueuedSpeech.StartLooping()
static int QueuedSpeech.GetCurrentIndex()
static void QueuedSpeech.PauseQueue()
static void QueuedSpeech.UnPauseQueue()

But again the link is broken and I couldn't try it.
#24
About the animation, you could add this inside rep_exec block as a workaround, and I also changed warlock_event to an Integer variable otherwise your next cutscene would be triggered anytime you enter the room:
Code: ags


function room_RepExec()
{

if(warlock_event == 1)
{  
  if(text1 != null && text1.Valid && !cWarlock.Animating)
  {
    cWarlock.Animate(talk_view, talk_loop, eOnce, eNoBlock);  //if warlock is saying text in bg and is not animating, animate him
  }

  if(current_line > 4) { //change to the max number of lines
    current_line=0; // When the warlock finishes his rant, he will begin again from the start
  }
   
  if(!interrupted)
  {
    if(text1 == null || !text1.Valid)
    {
      text1 = cWarlock.SayBackground(Lines[current_line]);
      current_line++;
    }
  }
  else
  {
    text1 = cWarlock.SayBackground("Now where was I? Ah yes...");
    current_line--;
    interrupted = false;
  }

}else if(warlock_event == 2)
{
// This will play a cutscene that will start after you return from a dialog which contains warlock_event=true; at the end
// And carry on with the rest of the game...
}
}
 


Do nothing:
warlock_event = 0;

Start event:
warlock_event = 1;

Event completed, launch cutscene:
warlock_event = 2;

When ranting and cutscene is over and game must go on:
warlock_event = 0;

I hope this fixes your problem and works as intended.
Edit again: Before I forget, you can also add a dummy last line, like: Line[5] = ""; and change the other reference to 5, so that you can actually interrupt the last sentence.
#25
If you only need this for one room, you could use the code like this:

Copy this at the top of room script outside functions:
Code: ags

String Lines[10];
int current_line;
bool warlock_event;
bool interrupted;      
Overlay *text1;


Copy this inside  room_load(), make sure you use the room property panel to create this function inside room script (before_fadein), do not write it by yourself:
It is just the definition of the dialog lines so you can later refer to them as Lines[index], it only needs to be called once.
Code: ags

  Lines[0] = "Hello young man";
  Lines[1] = "how are you";
  Lines[2] = "can I help you in any way?";


Copy this inside room_rep_exec(), also make sure to use the room property panel:
This is the part that displays the text and handles interruptions.
Code: ags

if(warlock_event)
{
  if(current_line > 2)   //event stops when warlock has said his last line (Lines[2])
    warlock_event = false;
   
  if(!interrupted)    //if the player isn't interrupting
  {
    if(text1 == null || !text1.Valid)    //if previous background text is gone
    {
      text1 = warlock.SayBackground(Lines[current_line]);    //say the line
      current_line++;
    }
  }
  else    //player has interrupted, skip current line, say interrupt text, and go back to previous line
  {
    text1 = warlock.SayBackground("You're interrupting me! What was I saying... Ah...");
    current_line--;
    interrupted = false;
  }
}


Now all you need to do is to write this when you want the ranting dialog to start:
Code: ags

warlock_event = true;


And this when the player examines an object or does something which is supposed to interrupt the ranting:
Code: ags

interrupted = true;


It will automatically do the job and stop once the ranting is over, if you want to start over later then just use "warlock_event = true;" again.   
I also used 'warlock.saybackground' as my test character which will need to be changed to your actual warlock character name.
If you add lines inside room_load, then you have to change the number at line 3 in the room_rep_exec block I wrote, as described in the comments.
#26
Hello,

I just wanted to offer an alternative, it is not the best way but could help if nothing else works.
You could store the dialog lines into an array and use an index to make it easier to manipulate.
game_start(),rep_exec() are just examples, I hope you get the idea.

Code: ags

//Copy to: top of the script outside functions

String Lines[10];
int current_line;
bool warlock_event;   //true: the event is active
bool interrupted;      
Overlay *text1;

//Copy to: game_start()

  Lines[0] = "Hello young man";
  Lines[1] = "how are you";
  Lines[2] = "can I help you in any way?";
  warlock_event = true;

//Copy to: repeatedly_execute()

if(warlock_event)
{
  if(current_line > 2)   //event stops when warlock has said his last line (Lines[2])
    warlock_event = false;
   
  if(!interrupted)    //if the player isn't interrupting
  {
    if(text1 == null || !text1.Valid)    //if previous background text is gone
    {
      text1 = warlock.SayBackground(Lines[current_line]);    //say the line
      current_line++;
    }
  }
  else    //player has interrupted, skip current line, say interrupt text, and go back to previous line
  {
    text1 = warlock.SayBackground("You're interrupting me! What was I saying... Ah...");
    current_line--;
    interrupted = false;
  }
}


You will need to use this in relevant places:

When the event starts.
Code: ags
warlock_event = true;


When the player interrupts him.
Code: ags
interrupted = true;

Edit: The last dialog line cannot be interrupted but it can be easily modified. I've also added comments if you're wondering what the code is about.
That's it, I hope you can get it to work with your scripts.
#27
I'm particularly intrested in this game, a serious theme and nice graphics (as usual). I like all those fancy things like reflection, sparkling cursor etc, and while you seem to be describing it like a 'half-ass' attempt, anyone can see a lot of effort went into this game so I'm highly anticipating 8-)

The best of luck!
#28
Quote from: Atelier on Wed 30/05/2012 21:10:52
I have a confession - I started working on a solution before I saw your reply :-[
Sorry I've seen your topic a bit late.

Anyways if you ever need a more comprehensive and extended functionality, here is a little modification of the code I gave. It can detect any fight/look/talk action with any of their (predifined) synonyms, if the target specified is an excluded word or is contained in more than one object/character's description then it will return negative. Otherwise you'll get 3 global variables filled : ParserCommand - ParserTargetType - ParserTargetID. (you need to create them as strings in the global var pane and the last one as INT)

Your final code w/o all the function declarations would look like this:
Code: ags

    if(GetParserAction(parser_string) > 0)
    {

      if(ParserCommand == "look")
      {
        if(ParserTargetType == "character")
        {
          //Display(character[ParserTargetID].Name);
        }
        else if(ParserTargetType == "object")
        {
          //Display(object[ParserTargetID].Name);
        }
      }
      else if(ParserCommand == "talk")
      {
        if(ParserTargetType == "character")
        {
          //talk to: character[ParserTargetID]
        }
        else if(ParserTargetType == "object")
        {
          //talk to: object[ParserTargetID]
        }        
      }
      else if(ParserCommand == "fight")
      {
        if(ParserTargetType == "character")
        {
          //fight: character[ParserTargetID]
        }
        else if(ParserTargetType == "object")
        {
          //fight: object[ParserTargetID]
        }        
      }
      
    }


If you have a character named Sephiroth and he's in the same room as the player, then these examples should yield the same result:
Code: ags

GetParserAction("fight sep");
GetParserAction("hit sephi");
GetParserAction("strike sephiroth");

//if no other character share the same name it will return 1 and fill Globals with appropriate values

ParserCommand -> "fight"
ParserTargetType -> "character"
ParserTargetID -> char_id


And here are the modified functions:
Code: ags

    int GetItemsCount(String the_str,  char separator)
    {
      int cnt = 0;
      int i = 0;
      while(i < the_str.Length)
      {
        if(the_str.Chars[i] == separator)
         cnt++;
        i++;
      }
      return cnt;
    }
     
    String GetItem(String the_str, int the_id,  char separator)
    {
      int i = 0;
      int cnt = 0;
      int last_cnt = 0;
      String result;
     
      while(i<the_str.Length)
      {
        if(the_str.Chars[i] == separator)
        {
          cnt++;
          if(cnt == the_id)
          {
            if(!last_cnt)
              result = the_str.Substring(last_cnt, i-last_cnt);
            else
              result = the_str.Substring(last_cnt+1, i-last_cnt-1);
             
            return result;
          }
          last_cnt = i;
        }
        i++;
      }
      return "";
    }
     
     
     
int GetParserAction(String input)
{
  String excluded = "the,it,for,to,of,at,";
  
  String syn_look ="look,lookat,watch,see,examine,";
  String syn_talk ="talk,speak,";
  String syn_fight ="fight,attack,hit,strike,";
  
  ParserCommand = "none";
  ParserTargetType = "none";
  ParserTargetID = -1;
  int match_id = -1;
     
  input = input.AppendChar(' ');
     
  if(GetItemsCount(input, ' ') <2)
    return -1;
    
  String command = GetItem(input, 1, ' ');     
  String target = GetItem(input, 2,  ' ');
  
  
  //Figure out which command the player typed
  int i = 1;
  int j = 0;
  int count = 0;
   
  count = GetItemsCount(syn_look, ',');
  i = 1;
  while(i<=count) 
  {
    if(command == GetItem(syn_look, i, ',' ))
      ParserCommand = "look";
    i++;
  }
  
  if(ParserCommand == "none")
  {
    count = GetItemsCount(syn_talk, ',');
    i = 1;
    while(i<=count) 
    {
      if(command == GetItem(syn_talk, i, ',' ))
        ParserCommand = "talk";
      i++;
    }
  }
  
  if(ParserCommand == "none")
  {     
    count = GetItemsCount(syn_fight, ',');
    i = 1;
    while(i<=count) 
    {
      if(command == GetItem(syn_fight, i, ',' ))
        ParserCommand = "fight";   
      i++;
    }
  }
  
  if(ParserCommand == "none")
    return -2;
    
    
  //Make sure the target isn't an excluded term
  i = 1;
  count = GetItemsCount(excluded, ',');
  while(i<=count) 
  {
    if(target == GetItem(excluded, i, ','))
      return -3;
    i++;
  }    
  
  
  //Cycle through room OBJECT names
  i = 0;
  count = 0;
  while(i<Room.ObjectCount)
  {
   if(object[i].Name.IndexOf(target) >= 0)
   {
     ParserTargetType = "object";
     ParserTargetID = i;
     count++;
   }
   i++;
  } 
  if(count>1)
    return -4;
  else if(count == 1)
    return 1;
    
    
  //Cycle through CHARACTER names
  i = 0;
  count = 0;
  while(i<Game.CharacterCount)
  {
   if(character[i].Room == player.Room && character[i].Name.IndexOf(target) >= 0)
   {
     ParserTargetType = "character";
     ParserTargetID = i;
     count++;
   }
   i++;
  } 
  if(count>1)
    return -4;
  else if(count == 1)
    return 1;
    
     
  return -5;
  
}


I hope it helps.
#29
Hi,

I hope this is what you are looking for, it should get the whole parser string as input, check the first word for any 'lookat' synonym, then check if the 2nd parser's word is contained in any of the current room objects description (excluding some common words like "the,at,to"). If it finds a match it will return the targetted object ID.

Code: ags

int GetItemsCount(String the_str,  char separator)
{
  int cnt = 0;
  int i = 0;
  while(i < the_str.Length)
  {
    if(the_str.Chars[i] == separator)
     cnt++;
    i++;
  }
  return cnt;
}

String GetItem(String the_str, int the_id,  char separator)
{
  int i = 0;
  int cnt = 0;
  int last_cnt = 0;
  String result;
  
  while(i<the_str.Length)
  {
    if(the_str.Chars[i] == separator)
    {
      cnt++;
      if(cnt == the_id)
      {
        if(!last_cnt)
          result = the_str.Substring(last_cnt, i-last_cnt);
        else
          result = the_str.Substring(last_cnt+1, i-last_cnt-1);
          
        return result;
      }
      last_cnt = i;
    }
    i++;
  }
  return "";
}


int GetParserTargetID(String input)
{
  String excluded = "the,it,for,to,of,at,";
  String syn_look ="look,lookat,watch,see,examine,";
  
  input = input.AppendChar(' ');
  
  if(GetItemsCount(input, ' ') <2)
    return -1;
    
  String input_item = GetItem(input, 2,  ' ');
  
  int i = 1;
  int j = 0;
  int count = 0;

  count = GetItemsCount(excluded, ',');
  while(i<=count) //if input is an exluded term, return
  {
    if(input_item == GetItem(excluded, i, ','))
      return -2;
    i++;
  }
  
  count = GetItemsCount(syn_look, ',');
  i = 1;
  while(i<=count) //for all look synonyms
  {
    if(input.StartsWith(GetItem(syn_look, i, ',' )))
    {
      j = 0;
      while(j<Room.ObjectCount)  //for all objects in room
      {
       if(object[j].Name.IndexOf(input_item) >=0) //if one of the terms match the object's name return its ID
         return j;
       j++;
      }
    }
    i++;
  }
  
  return -3;
}


int GetParserTargetID(String parser_string);
Currently only checks the second word in the parser string, but you can alter it to check for others, or even use GetItem() independantly. Returns negative value if no match, object ID (can be 0) if found.
#30
Sorry if this is obvious but the coordinates specified are room coords, so you may be drawing on a hidden part of the screen? The line can be seen because it goes all across the screen? (viewport problem)
#31
Thanks for the releases, these look fun! *downloads*
#32
The Rumpus Room / Re: Icey games' thread
Tue 15/05/2012 09:06:11
Square Penix *
-We make it where you get the DLC get the what you get and if you don't get it than that's that.  :=

Seriously, I don't know why it is so hard for you Icey to consider making a short simple game with basic elements IE:

-Introduce your world in a short intro(explaining what is the world, who is the hero, setting up some hopefully understandable background story)
-The Hero and the Lady are discussing some romantic stuff.
-The lady gets kidnapped by one of those monsters you've drawn, (they do look good btw)
-Take several rooms with one character to fight before you can go on to the next room, give them simple dialogs.
-Final fight.
-Ending scene where he gets the lady back(or not).
-Credits

It shouldn't require too much coding, while your art is honestly quite good and would deserve better treatment.
Try to keep your dialogs coherent and related to the story and it could be a nice start imho :P
#33
I needed something like that for a dialog gui, if I'm not misunderstanding it should be similar to your idea, and this is how I did it, although it's not really neat/tidy imho.
This code is for a listbox with up to three entries, acting as a dialog choice system so you can use it like this in the end:

int result = GetDialogChoice(); //wait until you click on one of the dialog options and return its id

Code: ags

//GuiDialogChoice - the Gui
//ChoicesBox - the Listbox

//global variable
  int DialogChoice;
 
//repeatedly execute always
 if(GuiDialogChoice.Visible)
 {
  int base_height = ChoicesBox.Height/3;
  if(mouse.x > GuiDialogChoice.X + ChoicesBox.X &&
     mouse.x < GuiDialogChoice.X + ChoicesBox.X + ChoicesBox.Width)
  {
    if(mouse.y > GuiDialogChoice.Y + ChoicesBox.Y &&
       mouse.y < GuiDialogChoice.Y + ChoicesBox.Y + base_height)
    {
      ChoicesBox.SelectedIndex=0;
      if(mouse.IsButtonDown(eMouseLeft))
        DialogChoice = 1;
    }
    else if(mouse.y > GuiDialogChoice.Y + ChoicesBox.Y + base_height &&
            mouse.y < GuiDialogChoice.Y + ChoicesBox.Y + (base_height *2) &&
            ChoicesBox.ItemCount > 1)
    {
      ChoicesBox.SelectedIndex=1;
      if(mouse.IsButtonDown(eMouseLeft))
        DialogChoice = 2;
    }
    else if(mouse.y > GuiDialogChoice.Y + ChoicesBox.Y + (base_height*2) &&
            mouse.y < GuiDialogChoice.Y + ChoicesBox.Y + (base_height*3) &&
            ChoicesBox.ItemCount > 2)
    {
      ChoicesBox.SelectedIndex=2;
      if(mouse.IsButtonDown(eMouseLeft))
        DialogChoice = 3;
    }
  }
 }
  

//the blocking function
int GetDialogChoice()
{
  DialogChoice = 0;
  GuiDialogChoice.Visible = true;

  while(!DialogChoice)
    Wait(GetGameSpeed()/10);

  GuiDialogChoice.Visible = false;
  return DialogChoice;
}


But then you will have to handle all the other events in rep_ex_always when your function is blocking.
#34
I had the occasion to hear some wonderful tracks from SwordOfKings128, and Fitz is working hard to bring us this little gem in time!

Quote from: Pablo on Mon 23/01/2012 13:30:31
I must get a boxed collector's edition of this game with that statue included!
I want that too, and the game on a 12+ floppy disks set!  :-*

Cheers!
#35
The Rumpus Room / Re: The lie thread
Sat 05/05/2012 06:29:31
Armageddon likes nipples and blunts.
#36
Sinsin: Why don't you take the lead (if you have time to dedicate to this), seeing how much motivation has been demonstrated, this could turn into another fine swarm project!
You would give the basic outlines and then call for help and organize the swarm :)

I'd be willing to work on a multiplayer feature, even if I fail in the end. I coded a working nbio tcp plugin for testing purpose, I can have a try after that week end and tell you.
The only problem I (fore)see with a multiplayer feat is the lack of bandwidth/cpu for clients (players computers), but it can be solved.

Anyways, good luck!
#37
The Rumpus Room / Re: The lie thread
Wed 02/05/2012 21:36:37
Fitz is actually Francis Scott Fitzgerald 's son and he's tied me up in his basement in order to do all the writing for him!
#38
Hello,

I'm not sure if that would do in your case but, say you have that picture with losanges and all (the same size as your background), now let's say you assign each one of them a different color, you would only have to load the picture to a drawing surface and then check : if(GetPixelAt(cEgo.X, cEgo.Y) == zone1_color) { //cEgo is in zone 1 }

This would allow you to have unlimited amount of zones, and more importantly, any kind of random shapes.

*Edit, It can be achieved with this:

Sample Code:
Code: ags

//global outside functions, preferably top of globalscript
  DrawingSurface *CurrentMap;

//room load
  DynamicSprite  *MapSprite = DynamicSprite.CreateFromExistingSprite(10);   //the sprite number corresponding to the colored zones image
  CurrentMap = MapSprite.GetDrawingSurface();

//room leave
  CurrentMap.Release();
  MapSprite.Delete();

//check pixel color at hero coords
  CurrentMap.GetPixel(cEgo.X, cEgo.Y);


You can play with it to suit your needs of course, this is just an example.
#39
Right, I was about to post something index driven like this, but you beat me ;)

As for the export declaration, I usually do it right after as well, but it is mentioned in the manual it has to be at the end, so I figured there's an obscure reason to it that may cause problems in other's scripts.
#40
AFAIK, Theora allows VP3 and OGG integration into AGS, so you can use .ogg .avi and more. I'm not familiar with FLC animations, but this problem has already been reported and not fixed, so maybe you should try a workaround, like making a video out of it or anything else, I'm sorry but I don't have many options to offer you, others may have some good ideas.
SMF spam blocked by CleanTalk