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

#2261
Okay, I'm just going to add my personal take on GlobalInts here, in case it helps.

A GlobalInt is what you use when, say, you want a different response for the same action after something has happened.

For example, if you look at a house, the character might say, "What a pretty house". If you break a window, and THEN look at the house, the character might say something different like, "There's a broken window".

In this example, you would use GlobalInts to tell the game what action would make the response change - in this case, the window breaking. You pick a number (any number) for the global int... this is just like a title to tell you which GlobalInt you're using for what. In this case, we'll say the number 1. Then you would make the second number (the number the global int "contains" 0 before the window is broken, and 1 if the window is broken.

So, Global Int number 1 will equal 0 before the broken window, and it will equal 1 when the window is broken.

To use this, you would tell the game when you look at the house, that if Global Int number 1 equals 0, to have the character say, "What a pretty house". If it equals 2, have the character say, "There's a broken window". Wherever in the game script you have the window break, you would include somewhere in that script a line telling the game to change Global Int number 1 to equal 1 (by default, it will be 0).

So, in the script [in the room editor => hotspot (house) interaction => Look At...] for the hotspot, you would put something like:

Code: ags

if (GetGlobalInt(1)==0) {
DisplaySpeech (EGO, "What a pretty house");
}

else if (GetGlobalInt(1)==1) {
DisplaySpeech (EGO, "There's a broken window");
}


In the script where the window gets broken, you would put:

Code: ags

SetGlobalInt(1,1);


...which would change the value of the Global Int #1 from 0 to 1.

This was as simply as I could put it, sorry if it's overboard, or if it doesn't answer your question.

///////////////////

A quick way to try this out yourself would be to open up a room, make a new hotspot, and then in the Interaction Editor for that hotspot, click on "Look At Hotspot", choose "Run script" and in that script put this:

Code: ags

if (GetGlobalInt(1)==0) {
DisplaySpeech (EGO, "Global Int number 1 equals 0");
SetGlobalInt (1,1);
}

else if (GetGlobalInt(1)==1) {
DisplaySpeech (EGO, "Global Int number 1 now equals 1");
}


Test your game in this room and try looking at the hotspot twice. This will change the value of the Global Int as soon as you've looked at the hotspot once. If you look at it a second time, the new interaction will be run. I'm assuming your main character is "EGO" (change it, if it isn't) and that you haven't used a GlobalInt anywhere else.
#2262
Haddas, I just want to say that your avatar is FABULOUS.
#2263
General Discussion / Re: Cingular Woes ...
Thu 01/07/2004 02:43:57
I've never heard of them but Darth, that story really pisses me off :P I'd be annoyed at your girlfriend paying half too... you can't give in! I hate businesses charging you for THEIR problems... if a busines can't do for you what they're supposed to do, you shouldn't be charged and if you're still with them, you should get some kind of compensation.

Bah!
#2264
What's wrong with this forum? You can do all those things here? Why on EARTH would you try to entice people away from this already established forum to another forum no better (and possibly worse because it has no members)?

Honestly, why make something when there's no market for it? I'm bewildered.
#2265
Quote from: Scummbuddy on Tue 29/06/2004 19:26:32
he just means stay off the forums if youre making a game.

There's no way I could do that, I rely heavily on the tech forum o_O

SierraFreak, hope you enjoy it here ^_^ I personally love these forums, even for the non-game talk... there seem to be fewer annoying bastards here than in most places on the internet and everyone's pretty friendly.
#2266
I -loved- that game >_< I used to have it on my old Amiga too, and I played it quite a bit. It did freak me out, but in a good way. I just wouldn't play it in the dark. It was fantastic because it combined my love of adventure games with my love of Geiger's work ^_^ There's a Dark Seed 2 as well as far as I know, though I haven't played it.

I think I have downloaded versions of them both somewhere, actually... I've never been able to make them work on any of my recent computers though. Pity.
#2267
It's possible he loves Sam and Max from the comics... I'm guessing there'd be a fair few Sam and Max fans in the world who haven't played the game. (just throwing this out there, believe me, I had all the normal reactions to his posts too.)
#2268
Yes, good luck because these things are hardly ever successful and it's always so disappointing ^_^

Er... by "funds"... do you mean... "backgrounds"? *slightly confused*

Also, who is "we" (Can't read much Spanish, sorry) and what have you got so far? You seem to be after people to do the backgrounds, sprites, music and programming... if this is the case, what are you doing yourself/ves?

Sorry for the questions but I'd just like some more info :)
#2269
Apologies for my ignorance, but how do I use it, then?
#2270
Good point, but I get an 'undefined token' error for 'on_key_press'...
#2271
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...
#2272
Just to clear up further... it's a tile-based RPG with a turn-based battle system, yes? So only one front facing image of each monster is required...

Are you doing the old, "mirror image" attack for each monster? :) (Not to imply that's bad, I love this stuff).
#2273
Just what kind of a game are you making? It's hard to know what style of monster to make without knowing that.
#2274
Christ, Blackthorne... I don't even have a penis but that story is -painful- >_< Those are exactly the kinds of problems I'm worried about, the semi-concious insertion and removal of foreign objects to and from small orifices. Big operations wouldn't bother me so much (why on earth does everyone have to be concious for things these days? I have NO problem with being out cold for a few hours while a doctor does something I don't wanna know about).

LGM: Me too, I have a terrible fear of throwing up :P Always have... if I feel like it may happen, even though I know I'd feel better for it, I'll do anything to stop it.
#2275
AGS Games in Production / Re: Lost Lands Rpg
Mon 28/06/2004 02:47:56
Hey, I'm making an RPG too ^_^ (slightly different concept though). It's great that people are doing such different things with AGS... can't wait to see how your turns out, good luck with it!!
#2276
Hints & Tips / Re: cirque de zale
Sun 27/06/2004 15:04:15
That was a problem with the original template I made the game from (so er... not my fault! ^_-).

It has been fixed now though, and you can download the latest (and final version) of the game from the Games page.
#2277
Hmm, seems you're right. I didn't realise the keyboard worked that way before now. My downstairs keyboard is fine but my other computer has the problem. It won't work when I push 'A', left arrow and up arrow at the same time. Using the numberic keypad is fine though. Thanks both of you, anyway.
#2278
Ah yeah, the A key needs to be held to run, but holding A doesn't make the character run. A along with a directional key need to be held for the character to run.
#2279
*groan* I have to dredge this one up again.

Everything works fine except for running up/left. Walking up/left works, but if I try to do it while running, it won't (it was just continue to go either straight left or up).

Code: ags

// --- 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;

if (IsKeyPressed(65)==1) { //RUNNING - 'A' button held down

Ã,  Ã, if (isRunning==0) {
Ã,  Ã,  Ã,  StopMoving(GetPlayerCharacter());
Ã,  Ã,  Ã,  SetCharacterSpeed(GetPlayerCharacter(), 12);
Ã,  Ã,  Ã,  isRunning = 1;
Ã,  Ã,  Ã,  Direction = DIR_STOP;
Ã,  Ã, }

} else {

Ã,  Ã, if (isRunning==1) {
Ã,  Ã,  Ã,  StopMoving(GetPlayerCharacter());
Ã,  Ã,  Ã,  SetCharacterSpeed(GetPlayerCharacter(), 6);
Ã,  Ã,  Ã,  isRunning = 0;
Ã,  Ã,  Ã,  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);
}
}
#2280
Hey, look :P All I know is that there are a lot of fried bats here hanging from wires.

It's kind of strange that NSW is referred to as the cockroach state when we seem to have so many in QLD. I've never seen a cane toad either @_@
SMF spam blocked by CleanTalk