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

Topics - Kinoko

#181
Advanced Technical Forum / Copying save slots
Tue 10/08/2004 12:04:06
Would it be possible to give the player the ability to 'Copy' a saved game to another slot? You can currently save, restore and erase but I can't think of a way to copy, which I think is a really handy feature (at least, it's something I use a lot because I'm paranoid about software screwups or something).
#182
General Discussion / Play your own games?
Mon 09/08/2004 15:51:36
I was just wondering if anyone here with one or more completed games actually plays them themselves. I know that I've NEVER actually played Cirque de Zale. I've played through it quickly probably hundreds of times to bug test and check animations, etc... but I've never once sat down, started it up and then just played it. I keep thinking I should but I don't know if I could.

It just occured to me because I was sitting there working on my new game thinking, "I wish I was playing this right now". I hope I don't have the same reaction to the new game when it's done... I'd like to be able to create something even I can enjoy, despite knowing the complete ins and outs of it and having seen each individual part over and over during the creation process.

Anyway, I just wondered what you other guys were like :)
#183
Is there a way to animate something without specifying a specific loop? For example, I want to have my character animate on button press with whichever loop corresponds to which way he's facing. I'm aware I could script in four 'if' statements relying on which view/sprite he's currently using, but I can't be sure exactly which view he'll be using at the time so this would be a royal pain in the ass.

Is there a better way? -_-
#184
I'm trying to make a variable that will show the elapsed playing time in my game. I've made it into a GUI on screen for now just so I can see it's working. It isn't right now, and I'm a bit stumped. I know I'm doing something(s) wrong but I don't know what to change.

Code: ags

if (GetGlobalInt(4)==1) {
Ã,  SetTimer(1, 2400);
Ã,  }

if (IsTimerExpired(1)==1) {
Ã,  second+=1;
Ã,  SetTimer(1, 2400);
Ã,  }

if (second==60) {
Ã,  second=0;
Ã,  minute+=1;
Ã,  }
if (minute==60) {
Ã,  minute=0;
Ã,  hour+=1;
Ã,  }

StrFormat (timehour, "%s", hour);
StrFormat (timeminute, "%s", minute);
StrCopy (time, timehour);
StrCat (time, ":");
StrCat (time, timeminute);

SetLabelText (12, 0, time);


The label itself works, and when the timer is trigger in the game, it goes blank, and a few seconds later, reads as, "(NULL):(NULL)"... so, the format is working but the timer isn't.

I've tried putting the SetLabel line in repeatedly execute and various other things that produce the same result.
#185
I need to set 4 labels in a GUI to read "EMPTY" the very first time the game is run, and then differ every other time depending on what the player has saved (that part I can figure out on my own).

The way I figured I'd do this (since I couldn't just SetLabelText to "EMPTY" in game start, as it would do that every time) is by inputting some misc text like "Nothing" into the GUI labels in the GUI editor, and in game_start (I tried a lot of things before I got to this code):

Code: ags

SetLabelText (11, 4, saveslota);
StrCopy (placename, "EMPTY");

if (StrComp ("Nothing", saveslota)==0) {
StrFormat (saveslota, "%s", placename);
}


(I'm using StrFormat instead of directly putting "EMPTY" in with StrCopy because it's convenient for me in the future.)

Of course this doesn't work because saveslota hasn't been given a string yet, which I didn't think about at first. Is there some way to read whatever text is directly typed into the GUI labels' properties window?

The only other way I can think of is to make the label a list box instead, and then use a code like:

Code: ags

ListBoxGetItemText (11, 26, 1, saveslota);

StrCopy (placename, "EMPTY");

if (StrComp ("Nothing", saveslota)==0) {
StrFormat (saveslota, "%s", placename);
}


Which then leaves me with the problem of inputting text into the listbox for the first time the game is executed only.

Anyone? ^_^; I'd appreciate any suggestions.
#186
Well, I was debating whether or not to do this when the game isn't close to being completed yet, but there is enough of it done to promise results so I figured, why not? It'd be nice to get some feedback.

-TITLE-

-INFO-
The game is called "Gift of Aldora" and is an RPG based mainly on the Enix style of SNES RPGs (free roaming, not tile-based, and not turn-based combat) but also including basic ideas taken from all my favourite RPGs and, of course, many of my own.

-STORY-
You play Kin, a guy living in the peaceful town of Boronia when one day you are approached by a girl named Kaya. She is a messenger sent by the controllers of Fate to find you. She tells you that the Master of Fate has dissapeared and as a result, the world is fading. It won't be long before everything is lost and the world ceases to exist. You are told that it is up to you to find him again before all is lost. What has happened to the master of Fate? What does destiny have in store for you? You and a companion must travel the world and find out.

-MORE INFO-
The battle system is live (as said before, not turn-based) and similar to the Secret of Mana/Terranigma style games. There will be (hopefully) a nice mix of role playing and combat. It will be completely keyboard controlled, and although the story is linear, there will be a reasonable amount of "extra" things to do and ways to change the story. The story will already deviate in certain ways depending on which companion you choose.

-SCREENSHOTS-








-SAMPLE MUSIC-
I'm not a musical person in the least, but I wanted everything in the game to be my own, so I've made 90% of the tracks myself. (Modgeulator did the theme music for me, which is -gorgeous- because he's a genius!)
http://kinoko.futariba.com/misc/home.mp3
http://kinoko.futariba.com/misc/icecave.mp3
http://kinoko.futariba.com/misc/porttown.mp3

I chose to upload these because they've already been posted in the critics forum, so it's not like they're a secret.

-WEBPAGE-
http://kinoko.futariba.com/games/gift/

-PROGRESS-
At this stage, it's probably about 25% completed, but it's hard to say.

-RELEASE DATE-
By end-2006 would be nice.

-DEMO-
Coming in the next few days!
#187
I have a character that I'd like to have move in the background (so, non-blocking) on a certain path, repeatedly, doing a little animation every now and again. I've written this is a function, but when I place the function in the room under "Repeatedly execute", the game kind of jumps a bit, and the character basically freezes in it's first movement. I put the function in the "After fade in" section of the room script, with a script to tell it that if the function is not currently happening, to happen. I'm not sure if I've done this right or not, but that basically does the same thing (character just freezes).

This is the function:
Code: ags

function BlueButterfly () {
Ã,  MoveCharacter (BLUEBUTT, 380, 166);
Ã,  MoveCharacterPath (BLUEBUTT, 360, 186);
Ã,  MoveCharacterPath (BLUEBUTT, 325, 155);
Ã,  SetCharacterView (BLUEBUTT, 16);
Ã,  AnimateCharacter (BLUEBUTT, 0, 1, 0);
Ã,  ReleaseCharacterView (BLUEBUTT);
Ã,  MoveCharacter (BLUEBUTT, 334, 149);
Ã,  MoveCharacterPath (BLUEBUTT, 343, 184);
Ã,  SetCharacterView (BLUEBUTT, 16);
Ã,  AnimateCharacter (BLUEBUTT, 0, 1, 0);
Ã,  ReleaseCharacterView (BLUEBUTT);
Ã,  }


...and here's the code in the room script:
Code: ags

BlueButterfly ();

if (BlueButterfly()==(0)) {
Ã,  BlueButterfly ();
Ã,  }


Any ideas?
#188
Critics' Lounge / Music for RPG
Thu 22/07/2004 14:00:21
Here: http://www.anime.com.au/Katt/misc/icecave.txt
...and Here: http://www.anime.com.au/Katt/misc/porttown.txt

are two pieces of music I've created for my RPG.

-PLEASE RENAME THEM TO MP3- (I can't upload mp3s or zipped mp3s to my server)

I'm just after a few opinions on whether these are satisfactory really. I'm NOT a musically minded person, I couldn't tell you which note was A and which note was G. I'm not expected to create masterpieces so... just keep that in mind ^_^ I created these with Sound Club, which I now think is amazing and I love it.
#189
I'm using Sierra style w/ backgrounds in my game, but for one or two functions, I need to use background-less text on screen. I made a new GUI text window and just left all the buttons and background without images, and also tried just using a fully transparent image as the background (which just registers as "no image")... I still get a black box behind the text. Is there a way around this?
#190
Is it possible to add/subtract/etc a particular value to/from a GlobalInt? Say HP in my game was GlobalInt #5, and I want to add whatever the current value of (int) mondmg is.

Currently, I'm using simple integers to simulate battles in my game, but the problem is that they keep resetting everytime the code for losing/gaining HP is used. I know why this is, but no good work around. I'm not sure if ints can be stored globally or not. Either way, if the GlobalInt thing works, that'll solve my problems.
#191
I'm playing around with the Random() function and in a lot of cases, it'd be  much easier for me if there were a minimum parameter as well as a maximum parameter. I'm not sure why there isn't already, is there an obvious work around? Or is it just much more difficult to build into the function? Just wondered :)
#192
General Discussion / SNES game instruments...
Wed 14/07/2004 08:40:44
Rather than use plain old hum-drum MIDI, I wanted to create the music for my SNES-style RPG with the original SNES sounds. I was wondering if it would be possible to get some program that simulates the same "instruments" game makers back in the day (specifically, the SNES day o_o) had to work with. This is a little out of my league, all this music bahjumboozle... so if I'm way off on the way it works, don't hurt me! Playing SNES games for so long, you get to know all the individual sounds that crop up over and over rather well, and I'd really like to be able to use them to create my own game music.
#193
I'd like in my TypeLine function for a specific key (X - 88) to have to be pushed before the overlay is removed, as opposed to any keypress at all doing it.

At the moment, the code is like:
Code: ags

function TypeLine (int message, int vspacing, int xpos, int font, int colour, int width, int delay, int wait) {
string line;
GetMessageText(message, line);

SetTextWindowGUI(1);
//declare local vars
Ã,  int length=0;
Ã,  int i = 0;
Ã,  string displayedline;
Ã,  int textid = 0;
//initialise vars , overdoing it a bit ;-)
Ã,  length = 0;Ã,  
Ã,  i=0; 
Ã,  StrCopy(displayedline,"");
Ã,  textid = CreateTextOverlay(xpos,100,400,font,colour,displayedline);

Ã,  Ã,  Ã,  Ã,  Ã,  //get string length, to know how long the loop must run
Ã,  length=StrLen(line); //set string length
Ã,  Ã,  Ã,  Ã,  Ã, //start loop
Ã,  Ã,  Ã,  Ã,  Ã, SetGlobalInt(0,1);
while((i<length) && (1||(WaitKey(delay)==0))) {
Ã,  Ã,  Ã,  Ã,  Ã, // pick character at position "i"and stick it at the end of string "displayed line"
Ã,  Ã,  StrFormat(displayedline, "%s%c", displayedline, StrGetCharAt(line,i));
Ã,  Ã,  Ã,  Ã,  Ã, //set textoverlay as displayedline
Ã,  Ã,  SetTextOverlay(textid,xpos,vspacing,width,font,colour,displayedline); 

Ã,  Ã,  Ã,  Ã,  Ã, // if a space is added to the string do not play a sound, else play a 'tick'
Ã,  Ã,  if (StrGetCharAt(line,i) == ' '){
Ã,  Ã, }
Ã,  Ã, else{
Ã,  Ã,  Ã,  Ã,  PlaySound(1);
Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //increase the loop counter
Ã,  Ã,  i++;Ã,  
[b]Ã,  Ã, if (i==length) if (wait>0) WaitKey(wait);
Ã,  Ã, else if (wait == -1) while (WaitKey(100) == 0) { }[/b]
Ã,  Ã, }
 RemoveOverlay(textid);
 SetGlobalInt(0,0);
 Wait(5);
}


Can I incorporate a (IsKeyPressed(88) ==1) line into it or something?
#194
I'd like to be able to have a GUI you can turn on at almost any point in the game, and when this GUI is on, everything going on in the background pauses. If I use PauseGame() with the opening and closing of the GUI, it works fine except I can't use keypresses to navigate around and use the GUI. Is there any way around this?
#195
Ref: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=14770.0

I'm using the Collision Detector plugin and trying to get it to work when two characters are touching, and then a specific (X - number 88) button is pressed.

At the moment, it works fine. When two characters are touching and X is pushed, a TypeLine function is run. While the text window is displayed, any key will remove the window (as it should) but if you push X to remove it, the window will just come up again instantly. I understand that this is working because I have the code in the 'repeatedly execute' part of the room script, but I'm not sure what I should do to get it to work the way I want.

What I'd like is for, if the TypeLine text window is currently displayed, pressing X will remove the window but won't set off the CD function again. Effectively, I guess, the CD function is disabled if a text window is on screen.

Here's what I have in my room script:
Code: ags

  // script for room: Repeatedly execute
int ret = boundingBoxColDetect (EGO, CD_CHARACTER, 11, 75, KAYA, CD_CHARACTER, 28, 75);  
if ((ret == CD_COLLISION) && (IsKeyPressed(88))) {
  
  FaceCharacter (KAYA, EGO);
  TypeLine (505, 100, 50, 1, 12, 200, 0, -1);
  
}


EDIT: I tried adding a SetGlobalInt (0,1); and a SetGlobalInt(0,0); line into the TypeLine script in the global script and changing the above code to if ((ret == CD_COLLISION) && (IsKeyPressed(88)) && (GetGlobalInt(0) == 0)) {.

This worked if, when the text window appeared, I *ever-so-quickly* tapped the X button. If I pressed it the way a normal person would, it would still bring the text window up again. I added a Wait(5); after the SetGlobalInt (0,0); line and it works pretty well now.

So, it's effectively solved but I just want someone's seal of approval on this method ^_^ I don't know if this is a messy way of doing it, or if there's a much easier way... this is going to be a VERY commonly used code in my game so I don't want to screw it up.

EDIT: Also, is there some way I can do this without using "ret"? If I do it this way, I have to come up with a new variable for EVERY line of text in the game...
#196
God, how can some companies be SO FREAKING incompetant. Me and my boyfriendÃ,  ordered something from playasia.com awhile back, and it should've arrived last week. We checked the tracking system and it arrived in Sydney (usually a good sign that means it'll be here in one or two days) on Sunday. Thursday - still not here. We check the tracking again and finally, four days later, they tell us that it's waiting for a phone number to be given to the order. See, that's funny, the phone number should be all over the order in various places, we know for a fact that they have it. Well, whatever, call their Sydney branch up and give them the phone number anyway.

Because my boyfriend has to work, I agree to stay home on Monday to receive the order. I make sure I don't play any music that day, and keep a constant ear out for a door knock. I can hear the people who lives 3 doors away when someone knocks at their door. Hmm, keep checking the door, wandering around the door all day. Go to check the mail at 4pm. Got one of those 'Undelivered package notices' - "Came at 14:40pm" - nothing else checked but the notice comes with a phone number to the Sydney office. Where was I at 2:40pm? Why, downstairs, sitting a couple of metres away from the door.

We give their office a call (pretty pissed off at this stage), and they can't do anything until the delivery guy comes back but promise to send it tomorrow. We confirm the address once again and, of course, we have that promise.

We check the tracking system online once again and lo and behold, the package was scanned in as undelivered at 2:17pm. Hang on, that's 23 minutes before he supposedly dropped the undelivered message in my letter box? HMM! I can't help feel that someone just got tired of working at the end of the day and delivered notices instead of packages.

So, once again, I sit at home all day. I leave both doors open, and I sit a couple of metres away from the door ALL day. There's no undelivered notice in the mail so I keep waiting. Once 4pm rolls around I call my boyfriend and he calls them again. What was that, phone answery person at UPS Brisbane? The package is sitting right next to you on your desk? You've been trying to call to confirm the address? Oh, and I was on the internet for most of the morning. Of course, it's our fault then, because it's NOT like we CONFIRMED THE ADDRESS WITH YOU LAST NIGHT right before you promised us that after that, all we had to do was await the package delivery tomorrow.

Of course, they can't deliver it today. Can't dare put any of their workers out to deliver a package after they come back into the depot, so we're getting it tomorrow.

Is it just me or should this company be slaughtered in awful, awful ways? I don't think I'm overreacting. They've put us out for over a week (for NO good reason but incompetance) and I've had to stay at home all day for 2 days near the front door waiting for a package that may not even exist. I can see this turning into one of those eternal struggles where I spend my life waiting for a package that was actually lost at sea only days after being sent out.

Fuck UPS. Yes, and that's what they are too. Fuck ups.
#197
General Discussion / Emergency numbers
Tue 22/06/2004 02:39:25
Just out of curiosity, I was wondering what the various emergency phone numbers in your respective countries are :)

In Australia, it's 000. I know from a lifetime of being bombarded with American tv that theirs is 911. Any others? (I have a feeling that Japan's is something like 119, I used to know it)
#198
Even though this post is related to the function discussed earlier (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=14733.msg179671#msg179671) I thought I'd post this seperately since the previous problem -was- solved and this is a further extension of that idea... and probably complicated.

Basically, as a recap, I have this code:

In script header
Quote
import function TypeLine(string line, int vspacing,  int xpos, int font, int colour);
In global script
Quote
function TypeLine(string line, int vspacing, int xpos, int font, int colour) {
 
//declare local vars
  int length=0;
  int i = 0;
  string displayedline;
  int textid = 0;
//initialise vars , overdoing it a bit ;-)
  length = 0; 
  i=0;
  StrCopy(displayedline," ");
  textid = CreateTextOverlay(xpos,50,400,font,colour,displayedline);

          //get string length, to know how long the loop must run
  length=StrLen(line); //set string length
         //start loop
  while(i<length){
         // pick character at position "i"and stick it at the end of string "displayed line"
    StrFormat(displayedline, "%s%c", displayedline, StrGetCharAt(line,i));
         //set textoverlay as displayedline
    SetTextOverlay(textid, 10,vspacing,400, font, colour, displayedline);

         // if a space is added to the string do not play a sound, else play a 'tick'
         Wait(10);
    if (StrGetCharAt(line,i) == ' '){
   }
   else{
        PlaySound(1);
        Wait(5);
    }
           //increase the loop counter
    i++;
  }
  return textid;
}

In room script
Quote
//type lines and play sound of ticking machine
int line1;
line1 = TypeLine(" First Line", 5, 50, 1, 3);
Wait(60);
int line2;
line2 = TypeLine(" Second Line", 5, 75, 1, 3);
Wait(60);
int line3;
line3 = TypeLine(" 3rd Line.", 5, 100, 1, 3);
Wait(60);

//after a pause the text is removed again
RemoveOverlay(line1);
RemoveOverlay(line2);
RemoveOverlay(line3);

}

(As a side note, this doesn't actually have the effect the last script would seem to suggest. Line 1 comes up fine, but disappears as soon as Line 2 appears, and the x position doesn't change between them - they all just start from the same place)

Usually I'd have a go at scripting this myself but I have no idea where to start with this one. I'm using the text window with background style of text display.

What I'd like to achieve is to modify the TypeLine function to always use the same size window regardless of text (I don't know if this is a matter of modifying the TypeLine function or whether it should be done elsewhere).

It already allows you to specify font and colour of text, but I'd also like to be able to control the x and y position of the text window, the speed of the typing, and if possible, have the text string point to a global message instead of typing the string out each time I use this function (though this one isn't a big deal). If possible (and I'm probably getting too ambitious here), I wondered about having another string parameter to specify a word or a phrase within the whole string to be highlighted (ie. coloured a set colour like yellow). So if the whole line of text was "This is a line of text." you could put in the highlight parameter "line" and that word would be yellow.

So maybe something like this - function TypeLine(string line, int ypos,  int xpos, int font, int colour, int speed, string highlight)

Also (feel free to shoot me), I wanted the text to be typed out as normal but instead of being controlled with 'wait's, to finish typing, and then stay on screen (blocking any other scripts) until a certain key is pushed (X = 88).

If anyone could offer any suggestions about this, point me in the right direction, whatever, anything, I'll REALLY appreciate it. I realise this is a lot all in one go but I'd rather do this then ask 50 different questions about the same essential piece of script in 50 different threads.
Quote
#199
I've implemented the script that allows action-style movement into my script and it works perfectly. My character walks when direction keys are held down with no problems.

Now, though, I'd like to be able to have the character run when I hold down the 'A' button. Basically, if I hold down 'A', and then press a direction key. I want him to run, OR if I am holding a direction key (ie walking) and while doing that, I hold down 'A', I want him to start running from the walk.

I realise you cannot change a characters speed while he is moving, so I was trying to achieve this by having him stop for a fraction of a second and then start running (a little jerkiness is a small sacrifice, I think). So, I've been mussing around with the code for awhile and I can get him to run when the 'A' button is pressed, but only after it has been let go. If I walk and then hold the A button, EGO stops until I release 'A' and then runs.

Also, if I let go of the direction button after that (stopping the character) and then hit a direction button again, he'll still be in run mode. I'm not sure exactly where I should reset his speed back to normal.

Here's the entire repeatedly execute script in my global script:
Quote
function repeatedly_execute() {
Ã,  // put anything you want to happen every game cycle here

// --- keyboard control ---
int CharId, Direction, dx, dy;
// neue Richtung ermitteln
if ((IsKeyPressed (371) > 0) || (IsKeyPressed (55) > 0) || ((IsKeyPressed (372) > 0) && (IsKeyPressed (375) > 0))) Direction = DIR_UP_LEFT;
else if ((IsKeyPressed (373) > 0) || (IsKeyPressed (57) > 0) || ((IsKeyPressed (372) > 0) && (IsKeyPressed (377) > 0))) Direction = DIR_UP_RIGHT;
else if ((IsKeyPressed (379) > 0) || (IsKeyPressed (49) > 0) || ((IsKeyPressed (380) > 0) && (IsKeyPressed (375) > 0))) Direction = DIR_DOWN_LEFT;
else if ((IsKeyPressed (381) > 0) || (IsKeyPressed (51) > 0) || ((IsKeyPressed (380) > 0) && (IsKeyPressed (377) > 0))) Direction =DIR_DOWN_RIGHT;
else if ((IsKeyPressed (372) > 0) || (IsKeyPressed (56) > 0)) Direction = DIR_UP;
else if ((IsKeyPressed (375) > 0) || (IsKeyPressed (52) > 0)) Direction = DIR_LEFT;
else if ((IsKeyPressed (376) > 0) || (IsKeyPressed (53) > 0)) Direction = DIR_STOP;
else if ((IsKeyPressed (377) > 0) || (IsKeyPressed (54) > 0)) Direction = DIR_RIGHT;
else if ((IsKeyPressed (380) > 0) || (IsKeyPressed (50) > 0)) Direction = DIR_DOWN;
else Direction = DIR_STOP;
// Vergleich mit aktueller Richtung
if (PrevDirection != Direction)
{
PrevDirection = Direction;
CharId = GetPlayerCharacter ();
if (Direction == DIR_STOP) { StopMoving (CharId); } // 5 Stop (numeric pad)
else
{
if (Direction == DIR_UP_LEFT) { dx = -DIR_DISTANCE; dy = -DIR_DISTANCE; } // 7 Home (numeric pad)
else if (Direction == DIR_UP) { dx = 0; dy = -DIR_DISTANCE; } // 8 Up arrow
else if (Direction == DIR_UP_RIGHT) { dx = DIR_DISTANCE; dy = -DIR_DISTANCE; } // 9 PgUp (numeric pad)
else if (Direction == DIR_LEFT) { dx = -DIR_DISTANCE; dy = 0; } // 4 Left arrow
else if (Direction == DIR_RIGHT) { dx = DIR_DISTANCE; dy = 0; } // 6 Right arrow
else if (Direction == DIR_DOWN_LEFT) { dx = -DIR_DISTANCE; dy = DIR_DISTANCE; } // 1 End (numeric pad)
else if (Direction == DIR_DOWN) { dx = 0; dy = DIR_DISTANCE; } // 2 Down arrow
else if (Direction == DIR_DOWN_RIGHT) { dx = DIR_DISTANCE; dy = DIR_DISTANCE; } // 3 PgDn (numeric pad)
MoveCharacterStraight (CharId, character [CharId].x + dx, character [CharId].y + dy);
}
}

Ã,  if (IsKeyPressed(65)==1) { //RUNNING - 'A' button held down
Ã,  Ã, 
Ã,  Ã,  Ã, if (Direction == DIR_UP_LEFT) {
Ã,  Ã,  Ã, StopMoving (EGO);
Ã,  Ã,  Ã, SetCharacterSpeed (EGO, 10);
Ã,  Ã,  Ã, dx = -DIR_DISTANCE; dy = -DIR_DISTANCE; }
Ã,  Ã, 
Ã,  Ã,  Ã, else if (Direction == DIR_UP) {
Ã,  Ã,  Ã, StopMoving (EGO);
Ã,  Ã,  Ã, SetCharacterSpeed (EGO, 10);
Ã,  Ã,  Ã, dx = 0; dy = -DIR_DISTANCE; } // 8 Up arrow
Ã,  Ã,  Ã, 
Ã,  Ã,  Ã, else if (Direction == DIR_UP_RIGHT) {
Ã,  Ã,  Ã, StopMoving (EGO);
Ã,  Ã,  Ã, SetCharacterSpeed (EGO, 10);
Ã,  Ã,  Ã, dx = DIR_DISTANCE; dy = -DIR_DISTANCE; } // 9 PgUp (numeric pad)
Ã,  Ã,  Ã, 
Ã,  Ã,  Ã, else if (Direction == DIR_LEFT) {
Ã,  Ã,  Ã, StopMoving (EGO);
Ã,  Ã,  Ã, SetCharacterSpeed (EGO, 10);
Ã,  Ã,  Ã, dx = -DIR_DISTANCE; dy = 0; } // 4 Left arrow
Ã,  Ã,  Ã, 
Ã,  Ã,  Ã, else if (Direction == DIR_RIGHT) {
Ã,  Ã,  Ã, StopMoving (EGO);
Ã,  Ã,  Ã, SetCharacterSpeed (EGO, 10);
Ã,  Ã,  Ã, dx = DIR_DISTANCE; dy = 0; } // 6 Right arrow
Ã,  Ã,  Ã, 
Ã,  Ã,  Ã, else if (Direction == DIR_DOWN_LEFT) {
Ã,  Ã,  Ã, StopMoving (EGO);
Ã,  Ã,  Ã, SetCharacterSpeed (EGO, 10);
Ã,  Ã,  Ã, dx = -DIR_DISTANCE; dy = DIR_DISTANCE; } // 1 End (numeric pad)
Ã,  Ã,  Ã, 
Ã,  Ã,  Ã, else if (Direction == DIR_DOWN) {
Ã,  Ã,  Ã, StopMoving (EGO);
Ã,  Ã,  Ã, SetCharacterSpeed (EGO, 10);
Ã,  Ã,  Ã, dx = 0; dy = DIR_DISTANCE; } // 2 Down arrow
Ã,  Ã,  Ã, 
Ã,  Ã,  Ã, else if (Direction == DIR_DOWN_RIGHT) {
Ã,  Ã,  Ã, StopMoving (EGO);
Ã,  Ã,  Ã, SetCharacterSpeed (EGO, 10);
Ã,  Ã,  Ã, dx = DIR_DISTANCE; dy = DIR_DISTANCE; } // 3 PgDn (numeric pad)
Ã,  Ã,  Ã, 
Ã,  Ã,  Ã, MoveCharacterStraight (EGO, character [EGO].x + dx, character [EGO].y + dy);
Ã,  Ã,  Ã, }
Ã,  Ã, 
}

I'm sure it's as messy as hell but I've been steadily making progress up until now. I can't really think of how to get around this though I'm sure it's obvious. Can anyone help?
#200
I'd like to know if someone could give me an idea of how to create a feature in an RPG I'm hoping to make with AGS. Basically, I'd like to be able to call a function with certain pieces of text that makes the text appear letter by letter until it has written the whole string out.

If anyone knows a program called 'ika', it uses a code based on a language called Python, which I'm very, very new to. I'll just show you a section in their tutorials that talks about how this program deals with this particular function.


QuoteScrolling
Looking at the pages isn't very interesting when it instantly all appears.. what we would like is for the text to scroll by character by character. Again, this isn't hard to do. We'll have a list to store the scroll positions of each line, and a variable to store which line is currently scrolling. Add this in between the two while loops:

Ã,  Ã,  Ã,  Ã, scroll = [0, 0, 0, 0]
Ã,  Ã,  Ã,  Ã, curline = 0

We put it here because we want these values to reset every time we reach a new page. Next, we need the part that actually does the work, which we add at the top of the for loop, before we Print:

Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, if curline == i:
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  scroll[curline] += 1
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if scroll[curline] == len(line): curline += 1

This says if we're looking at the currently scrolling line, increment its scroll position, and look at the next line once it's reached the end of the current one. Pretty simple. :)

Finally, a simple modification so that we print just the part of the line that we want:

Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, font.Print(15, ika.Video.yres-70+15*i, line[:scroll])

The line[:scroll] part returns the string from the beginning of the line, to the current scroll position. As you can see, slicing is really coming in handy here. :)

Now if you run it, depending on your machine, it will either run way too fast, or too slow, or maybe just right depending on your framerate. This isn't good - we want it to scroll the same speed no matter what the framerate is.

Fortunately, it's again easy to modify. Insert this line just after curline = 0:

Ã,  Ã,  Ã,  Ã, time = ika.GetTime()

This will store the time when we started the loop. Now, inside the for loop, we want this:

Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, if curline == i and ika.GetTime() - time >= 2:
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  time = ika.GetTime()

We added a part to the for loop that ensures at least 2 ticks go by before it scrolls to the next character. You can play with the number a little bit if you think it's too fast or too slow, although because ika only uses 100 ticks per second, the accuracy isn't as great as it could be.

The entire article can be found here: http://ika.sourceforge.net/articles.php?view=10


Obviously a lot of things in there are very specific to this particular code but I just put it there in case it gave anyone any ideas. I've had a bit of a think myself but I'm just -not- at the scripting level where I can do this without help.
SMF spam blocked by CleanTalk