Map problems

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

Previous topic - Next topic

Tanker

Well im making this game with a map, and when you clik on it it takes you to another room, sort of a closeup of the map.But the problem is if you view the map from another room, it takes you back to the first room.What i want to do is tell the game to take the character to the room he was in . But i dont know how  ;D . Can anyone help me  :'( ?

..

Eek.. Double post :O

Never mind...

See this thread :

http://www.agsforums.com/yabb/index.php?topic=13954.msg169143#msg169143

And scroll down a bit, this person had the same problem, kind of.

Scorpiorus

Yeah, use the following script code to return to the previous room:

NewRoom(character[GetPlayerCharacter()].prevroom);

Tanker

Thanks a lot i fixed it  ;) ! But how do you add a score box in the status bar that shows your current score?

..

Make a label and set its text to one of the following (whichever you want)

@SCORE@       The player's current score
@SCORETEXT@   The text "Score: X of XX" with the relevant numbers filled in.
@TOTALSCORE@  The maximum possible score, specified on the Game Settings pane

Tanker

Hey can you make an enable region or a disble hotspot? Because im making a game, and when you enter a room the outside room darkens up. But i cant seem to do it right. Can you help me?

Scorpiorus

Well, you can disable/enable hotspots using these commands:

DisableHotspot (hotspotNum)
EnableHotspot (hotspotNum)

...and the regions:

DisableRegion (regionNum)
EnableRegion (regionNum)

Tanker

Ok i fixed that but thanks anyway. Hey if i want to create a script for a dialog, like if you have an item and it enables an option, and i put it in the room script will it run on its own or only in the dialog when run script is written?

Scorpiorus

#8
You don't put it in the room script but write a special function in the main global script and call it from the dialog script, for example:

dialog script: (option 2 is initially off)
@s
return
@1 // simple hello option
ego: hey hello
wizard: greetings stranger
run-script 1 // to check if the option 2 can be enabled
return
@2
wizard: have you brought the item?
ego: yeah, here it is!
wizard: good! now ask what do you want?
ego: I WANNA RULE THE WORLD!!!11!11!!
wizard: hahaha! poor man! No, you don't!
stop

main global script:

//main global script

function dialog_request(int value) {

   if (value==1) {Ã,  // if we have called this function with run-script 1

      if (character[GetPlayerCharacter()].inv[SOME_ITEM_NUM] > 0) {
         SetDialogOption (topic, 2, 1);
      }

   }
}

Tanker

Hey thanks i did the code exactly like yours but i was writing it in the room script hanks a lot man. Listen to this.I am making a conversation with 2 guys and at the bigining they say a long conversation.How do i make it that if you talked to them already it just shows a simple message like "hello" or something?Thanks

Scorpiorus

#10
You should set a GlobalInt when they have talked the first time and then check it when the player runs the conversation again. How did you make the conversation? With the DisplaySpeech command? Or running a dialog topic? Did you put it under @S token?

Tanker

I wrote the code like this and its saying there is an error when i try to save, whats the problem?

function dialog_request(1) { <= Error in this line

   if (value==1)

      if (character[GetPlayerCharacter(2)].inv[1] > 0) {
         SetDialogOption (topic, 0, 7);
      }

   }
}

strazer

function dialog_request(int value) {

   if (value==1) {

      if (character[GetPlayerCharacter(2)].inv[1] > 0) {
         SetDialogOption (topic, 0, 7);
      }

   }
}

"int value" means that the value of the parameter (the "1" in "run-script 1") you pass to this function is stored in the integer variable named value.
With
  if (value==1) {
you check if this variable is set 1 (i.e. "run-script 1" was used). The code enclosed in the brackets is then executed.

To check if "run-script 2" was used, you just have to check if value is 2. Thus you would do:

function dialog_request(int value) {

   if (value==1) {

      if (character[GetPlayerCharacter(2)].inv[1] > 0) {
         SetDialogOption (topic, 0, 7);
      }

   }
   else // value is something else than the above
   if (value==2) { // run-script 2 was used
      // do stuff
   }

   // check for value==3 and so on
}

Estaog

#13
function dialog_request(int value) {

Ã,  Ã, if (value==1)

Ã,  Ã,  Ã,  if (character[GetPlayerCharacter(2)].inv[1] > 0) {
Ã,  Ã,  Ã,  Ã,  Ã, SetDialogOption (topic, 0, 7);
Ã,  Ã,  Ã,  }

Ã,  Ã, }
}

I wrote it like that and its saying there is something wrong with the get playercharacter command. Whats wrong?

Edit: how do ise game.bgspeech_stay_on_display ?
Think about the kittens man!

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

strazer

Oops, didn't see that:

function dialog_request(int value) {
   if (value==1) {
      if (character[GetPlayerCharacter() ].inv[1] > 0) {
         SetDialogOption (topic, 0, 7);
      }
   }
}

And in the SetDialogOption function, you have to replace "topic" with the number of the dialog topic.
The second parameter has to be at least 1.
The last parameter can only be 0, 1 or 2.
Check the manual!

Quotehow do ise game.bgspeech_stay_on_display ?

Put this in your game_start function:

  game.bgspeech_stay_on_display = 1;

Then background speech isn't removed when doing DisplaySpeech.

Estaog

Hey thanks for all you help i really appritiate it. Im sort of a noob so i do need some help cos im making quite a complicated game for a first one. I know variables are very usefull but i dont know how to use them. Could you point to something that will help me or just tell me yourself? Thanks!  ;D
Think about the kittens man!

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

strazer

You're welcome. :)

What is there to tell about variables? I wouldn't know where to begin.
Read this and feel free to ask any specific questions.

Estaog

Ok im getting the hang of variables. I was wondering did anyone ever produce a commercial game with this programm, cos i think it is possible. They should do a cd, named "The advantures return!" (sorry about the spelling) and put the best game donw by this programm in it. good idea huh but i think its a bit complicated to publish a game. With the display speech , you can show how many mesasges you want?
Think about the kittens man!

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

strazer

#18
I think The Adventures of Fatman was the first game made with AGS that was being sold.
It's officially abandonware now, so you can legally download it.

With DisplaySpeech you can display as many sentences as you want, because you pass the text directly, like this:

DisplaySpeech(EGO, "This is simple text, not a message!");

Estaog

Hey can you make a character play a view? Not a flik. Whats the code for it?
Think about the kittens man!

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

SMF spam blocked by CleanTalk