Map problems

Started by , Sat 22/05/2004 11:50:55

Previous topic - Next topic

TerranRich

Jesus Christ, Tanker, most of your questions can be answered by reading the Beginners' FAQ. Please read it THOROUGHLY before asking anything else. Also read the manual THOROUGHLY, search through it, and the AGS web site has some good resources as well. So please ask questions that are NOT in any of these resources. Otherwise, this thread will be locked. Thanks.

As for your question, look up the manual. Search for "character" or "view". That's what it's there for. Thanks.
Status: Trying to come up with some ideas...

Estaog

Oh sorry im quite the lazy ass.What happens is i have a problem, i post it and then before you answer it i fix it. ;D
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Estaog

#22
Import int photo;

if (photo==0) {
Ã,  Displayspeech ('I have a probelm with cursing.');
}
if (photo==1) {
Ã,  Displayspeech ('I also have a problem with cursing.');
}

I tried this script in an inventry object and it wont let me import the integer so the script wont work. How can i do this in an inventry object?
Ã, 
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Scorpiorus

To import a variable put import int photo; at the very top of that room script.

Also, you have to export that variable from the main global script by putting the following line at the very bottom of the main global script:

export photo;

Of course, the variable itself has to be declared at the top of the main global script:

// main global script:

int photo;

Estaog

Did you even read my question, i have a problem using it in an inventory item.
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Scummbuddy

a) you probably don't have permission to hot link from The Legend of Monkey Island, so i would immediatly take those out of your signature.
b) Your signature is too big, please condense it.
c) If Scorp, who very nicely answers questions, didnt answer your question, then could you elaborate?
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Estaog

I just told him to read the question cos thats not what i wanted thats all. And there wasnt anything that said do not hot link on legend of mi.I removed
a gif so its smaller.
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Scorpiorus

"To import a variable put import int photo; at the very top of that room script."

But you put it at the top of inventory item script. Btw, since it's an inventory item you can just remove the import int photo line at all. That's because all inventory item script functions are located within the main global script where the photo variable is actually declared.

hope that helps

Scummbuddy

its good internet etiqutte to not hot link without permission. save it to your own server, or use the uploader here: http://www.agsforums.com/yabb/index.php?topic=3584.0
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Estaog

OK thanks for the help. But i cant understand one thing. I have a global varieble  and i imported it into 2 rooms.Now as you enter the first room it sets the int to 1.And in room 2 there is a script like this:

if (watever==1)
{ objecton (1); }

but it never seems to work .The object just stajs the same.Do i have to use a command that exports the int from room1 to room2?
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Estaog

Never mind i did it. But how do you make a boolean in the script. I cant find it anywhere.
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Scorpiorus

You just use INTs:

int booleanVariable = 1; // means TRUE

...

if (booleanVariable == 0) {

// if boolean Variable is False

} else {

// if it's TRUE

}

Estaog

Can i tell the game to stop at a point?

if (character[GetPlayerCharacter()].inv[24])
{ MoveCharacterToObject (2, 2);
  DisplaySpeech (2, "Il just light it on.");
  DisplaySpeech (2, "The lighter stopped working again! Piece of shit!");
  LoseInventory (24);
  SetObjectView (2,15);
  AnimateObject (2,0,0,1);
  candle=1;
}
<= stop here

if (character[GetPlayerCharacter()].inv[20])
{  if (candle==1)
   {  MoveCharacterToObject (2,2);
      Display ("You look at the index and find the spell Reversal on page 80.");
      DisplaySpeech (2, "So lets se here..77...79...and here it is page 80!");
      DisplaySpeech (2, "It says here to light a black candle near the place the spell was cast....");
      DisplaySpeech (2, "Done.");
      DisplaySpeech (2, "....and to read the following:");
      DisplaySpeech (2, "Ade tu uja");
      DisplaySpeech (2, "By the lord of darkness");
      DisplaySpeech (2, "Give me the power i beg of you!");
      Display ("You feel empowered, a beam of dark light emerges from your chest and breaks the barrier.");
      DisplaySpeech (2, "Hey it worked.");
      SetObjectGraphic (2, 348);
      candle=2;
      ObjectOff (1);

Because it runs the actions after each other for some unkown reason.
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Scorpiorus

It runs the second part because you set candle = 1 at the end of the first one. Put "else" where "<= stop here" is:

if (character[GetPlayerCharacter()].inv[24])
{ MoveCharacterToObject (2, 2);
Ã,  DisplaySpeech (2, "Il just light it on.");
Ã,  DisplaySpeech (2, "The lighter stopped working again! Piece of shit!");
Ã,  LoseInventory (24);
Ã,  SetObjectView (2,15);
Ã,  AnimateObject (2,0,0,1);
Ã,  candle=1;
}
else if (character[GetPlayerCharacter()].inv[20])
{Ã,  if (candle==1)
Ã,  Ã, {Ã,  MoveCharacterToObject (2,2);
Ã,  Ã,  Ã,  Display ("You look at the index and find the spell Reversal on page 80.");
Ã,  Ã,  Ã,  DisplaySpeech (2, "So lets se here..77...79...and here it is page 80!");
...
...
...

Estaog

#34
Problems with gui:

Ok so i made a gui with 2 buttons. It will be a death screen (when you die it appears).But there are 2 things i cannot do. Where do you write the script for the buttons because when you cvlick edit script it only shows the script for the first gui.And the second problem is that i want it to stop the game running and let you only press the load and save buttons (wich are on the gui).Thanks. ???

Edit:
Why is it giving me an error in this script?

if (character[GetPlayerCharacter()].activeinv[24])
{ MoveCharacterToObject (2, 2);
  DisplaySpeech (2, "Il just light it on.");
  DisplaySpeech (2, "The lighter stopped working again! Piece of shit!");
  LoseInventory (24);
  SetObjectView (2,15);
  AnimateObject (2,0,0,1);
  candle=1;
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Scorpiorus

Quote from: Tanker on Sun 30/05/2004 10:44:39Where do you write the script for the buttons because when you cvlick edit script it only shows the script for the first gui.
Just add the code for the death GUI:

if (interface==DEATHGUI) {

if (button == 0) { ... }
if (button == 1) { ... }

}

QuoteAnd the second problem is that i want it to stop the game running and let you only press the load and save buttons (wich are on the gui).
Set that GUI's visible property to Popup Modal. Thus it will pause the game.

QuoteWhy is it giving me an error in this script?
Could you be more specific about the error you get, what's error message? Furthermore, does it display the error during saving of the script or at run-time?

Estaog

Thanks a lot for your help. But tell me if you use Movecharactertopath , can you use it to make a guy patrol continuasly?
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Scorpiorus

Yeah, you can loop it by checking a character[].walking variable within the room's repeatedly execute:

room's repeatedly execute:

if (character[PATROL].walking == 0) {

   MoveCharacterPath(PATROL, x1, y1);
   MoveCharacterPath(PATROL, x2, y2);
   MoveCharacterPath(PATROL, x3, y3);
   MoveCharacterPath(PATROL, x4, y4);
}

Estaog

Is there a command that tells the player to always be on top of objects in a room?
Think about the kittens man!

http://members.aol.com/johnk0/godkills.jpg

Scorpiorus

Simply set his baseline a value equal to room's height:

SetCharacterBaseline (GetPlayerCharacter(), game.room_height);

SMF spam blocked by CleanTalk