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

#301
The Rumpus Room / The 'Three Sea Shells'
Wed 20/06/2012 02:29:12
Hi All Good Peeps.

How Does The 'Three Sea Shells' Work in the, Stallone, film 'Demolition Man'.
I have heard some hilarious answers, all over the web, but want to hear more.

This has been a mystery to many people.
Share your thoughts...Please.

Jay.
#302
Hi Khris.

Ah ha!
I see it all now... some of it. (Damn I was close, just not close enough.)

Works wonderfully. :)

I have edited my top post to mirror these changes, just incase this can help anyone else.

Many Thanks Khris.
Jay.
#303
Hi all good peeps.

I have all of my Quit, Save and Load GUI's working just fine.

However.
What I want is for a "Do you want to overwrite this saved game?" GUI to appear if there is already a saved game with that name.
I have done pretty much the same with a delete confirmation GUI and had no probs but this has me stumped.

The code bellow is linked to my Save button on the Save GUI.
What I would like to know is.
At what point would I open the confirmation GUI (I thought just after "// If so, overwrite the selected save game").
Also what script do I need to link to the confirmation GUI's  "Yes" button to get this to work?
I nearly had it working once but then it all went even more pear shaped than your average pear.

EDIT:
The script bellow, with the help of Khris, works just how I wanted it to now. :)
Here it is. ;)

As it says bellow. Put this at top of Global Script.
Code: ags

// top of global script
int temp_savegame_index;
String temp_savename;

------------------------------------------------------------
This I put into the Save button on the Save GUI
Code: ags

function btnConfirmSave_Click(GUIControl *control, MouseButton button) {

// Player pushed Save button on Save GUI  
  int totalSaves = lstSaveGames.ItemCount; //number of saves on list
  String saveName = txtSaveNames.Text; //holds value of txtSaveName
 
// Check for a save name. If none, tell them.  Else, go on.
  if (saveName == "") 
  {
    Display("Please enter a name for your saved game.");
    return;
  }
  
// If there is no saved games yet, just save it.
  if (lstSaveGames.SelectedIndex == -1)
  {
    gSavegame.Visible = false;
    mouse.Mode = eModeInteract;
    mouse.SetBounds(0,0,0,0);
    SaveGameSlot(totalSaves+1, saveName);
    Wait(20);
    Display ("Game saved successfully.");
  }
  
  else
  {
    int checkSave = 0; //runs through the list and checks for double entries
    while (checkSave != totalSaves)
    {
      if (saveName == lstSaveGames.Items[checkSave]) // one matches, so overwrite it.
      {
        // If so, overwrite the selected save game
        temp_savegame_index = savegameindex[checkSave];
        temp_savename = saveName;
        mouse.SetBounds(94, 105, 225, 134);
        gOverwrite.Visible = true;
        return;
      }
      checkSave++;
    }
    
    // There is no match, just save to a new slot.
    if (totalSaves < 10)
    {
      mouse.Mode = eModeInteract;
      mouse.SetBounds(0,0,0,0);
      gSavegame.Visible = false;
      SaveGameSlot(totalSaves+1, saveName);
      Wait(20);
      Display ("Game saved successfully.");
    }
    
    else
    {
      Display("The maximum number of saved games has been reached; overwrite or delete some old ones.");
    }
  }
}

---------------------------------------------------------------------------
This I put into the Yes Button on the confirmation GUI.
Code: ags

function btnOverwrite_Yes_Click(GUIControl *control, MouseButton button) {

// If confirmation GUI's Yes button is clicked:
  SaveGameSlot(temp_savegame_index, temp_savename);
  gOverwrite.Visible = false;
  gSavegame.Visible = false;
  mouse.Mode = eModeInteract;
  mouse.SetBounds(0, 0, 0, 0);
  Wait(20);
  Display ("Game saved successfully.");
}


EDIT:
I cleaned the script up a bit. Hope it's easier to read now.

Many thanks.
Jay.
#304
Hi, again, Iceboty

My Load screen works just how I want it to now.

Thank you ever so much for your help. I realy appreciate it.

Jay.
#305
Sorry.

Yeah. The label idea works aswell. I just tried it.

It has the same prob as the text box, though.
Once the save has been deleted the name is still there until you click on another save.

Is there a way to clear the Label or TextBox once the save has been deleted or to make it display the next save down, even?

Edit:
Damn. this is getting confusing. I finish my message go back and you have already replied.
I will do as you suggest.

Many thanks for your help.

Jay.

#306
Hi Iceboty.

What it's for is the load screen.

I have a Delete button.
when the player selects a game, from the list, they wish to delete the name of that save is displayed in the textbox.

It's just a way, for the player, to confirm that it's the correct save they are about to delete.

Edit:
Ooh! That's close. txtLoadName.Enable = false; works.
Is there a way of clearing the textbox once the game has been deleted, though.

Many thanks.
Jay.
#307
Hi Peeps.

Ok. I have created my own load, save, and quit GUI's.
On the load gui I have a text box that when you click on a save from the list appears in this textbox.

The problem is, though, that if the player types anything it goes in to the box (obviously).
I want the textbox to be un-editable and just show a line of text without the player being able to change it.
I understood, by what I was reading, that this line was what I needed:-

Code: ags

txtLoadName.Clickable = false;


Alas. This doesn't work.
I have been trying to use the search to get the answer to this problem but am having probs with it... again. ::)
Tried the Wiki and found the same line as I have been using, to no avail.

Any help would be fantastic.

Jay.
#308
Hi Khris.

I already tried that.
With that line at the top of the first section the bottom section doesn't get run at all. ???

I am confussed.

EDIT:
Oh. Forget what I just said.

All I needed was to put the extra '}' at the bottom of the first section, as you already showed me.
For some reason I completely ignored the "AROUND" bit in "put this around the top part". ::)
I have updated the script above.

Sorry to have wasted your time, Khris.
I think I can re-Solvicate this now. :)

Thank you ever so much.

Jay.
#309
Hi all.

The script bellow, nearly, works. Just one stupid thing is bothering me.

The top section works fine.
However. If you have done the thing you need to do.
The first comment happens in the top section and then runs the bottom section.

could someone, please, take a look at this script and tell me why  

Code: ags

// script for Object 6 (Mushroom1): Interact object

if (John_Examine_Mushroom == false){
if (killer_mushroom == 0) {
    cEgo.Say("This could be poisoness.");
}
if (killer_mushroom == 1) {
    cEgo.Say("I don't know if I should touch this.");
}
if (killer_mushroom == 2) {
    cEgo.Say("I like mushrooms. They're tasty.");
}
if (killer_mushroom == 3) {
  cEgo.Say("Oh. Hell. I'll take it. What's the worst that could happen.");
  Wait(20);
  cEgo.Say("Oh. I don't feel so good.");
  Wait(20);
  mouse.Visible = false;
    
  if (player.View == 1){
    int align = (cEgo.Loop == 1) * eAlignRight + (cEgo.Loop == 2) * eAlignLeft;
    cEgo.LockViewAligned(29, cEgo.Loop, align);
    cEgo.Animate(cEgo.Loop, 5, eOnce, eBlock, eForwards);
  }
  
  if (player.View == 12){
    int align = (cEgo.Loop == 1) * eAlignRight + (cEgo.Loop == 2) * eAlignLeft;
    cEgo.LockViewAligned(39, cEgo.Loop, align);
    cEgo.Animate(cEgo.Loop, 5, eOnce, eBlock, eForwards);
  }
  
    Display("Well. That was just stupid. You are dead.");
    FadeOut(1);
    RestartGame();
}
  
if (killer_mushroom < 3) {
  killer_mushroom +=1;
 }
}
-----------------------------------------------------------------------------
 
if (John_Examine_Mushroom == true){
  cEgo.Say("I think that this mushroom is what John wants.");
   
 if (cEgo.InventoryQuantity[18] > 0){
   cEgo.Say("I'll take this one.");
   object[3].Visible = false;
   cEgo.LoseInventory(inventory[18]);
   cEgo.AddInventory(inventory[2]);
   Display("Mushroom added to inventory.");
   Wait(20);
   cEgo.Say("That's it I now have the two mushrooms John wants.");
}

 else{
   cEgo.Say("This is one I need.");
   object[3].Visible = false;
   cEgo.AddInventory(inventory[18]);
    Display("Mushroom added to inventory.");
   Wait(20);
   cEgo.Say("I need to find one more.");
  }
 }
}


What am I missing here?
Many, Many thanks.

Jay.
#310
Hi Khris.

Once again I bow down before your greatness. :)

That works like a charm.
I am still slightly bemused by these 'int' thingies.

There is one small error in your code I found.
On the second line you have put 'eEgo' instead of 'cEgo'.

If I just say "Thank you infinite" that should cover now and future problem solving. ;)

Many thanks.
Jay.
#311
Hi all.

I have made a view. within this view I have frames of Ego falling over (to the left) in loop 1 and (to the right) in loop 2.

The script bellow works well, if Ego is already facing left.
However. If Ego is facing right he uses (obviously) the same loop (loop 1), which is wrong and looks crap.

Code: ags

// script for Object 4 (Mushroom2): Interact object

if (John_Examine_Mushroom == true){
  cEgo.Say("I'll take this.");
  Wait(20);
  cEgo.Say("Oh. I don't feel so good.");
  cEgo.Say("I think I may have made a fatal error.");
  Wait(20);
  mouse.Visible = false;
  character[EGO].LockViewAligned(29,1, eAlignLeft);
  character[EGO].Animate(1, 5, eOnce, eBlock, eForwards);
  Display("Well. That was just stupid. You are dead.");
  FadeOut(1);
  RestartGame();
}


How on earth can I get the correct loop to play depending on what way Ego is facing in the game.
I have looked in the manual, I have searched and tinkered about with this for days and can't get it to work the way I would like. :'(

Any help would be greatly appreciated.
Many thanks.

Jay.
#312
Hi all, again.

I want to thank everyone who has helped with my problem.

Khris, Miglioshin and Kweepa.

Khris, With code.
Miglioshin, With sound.
Kweepa, With placing of script.

My room works just how I want it to.
Thank you, all.

Much appreciated.
Jay.
#313
The change over shouldn't be to difficult, I hope.

I have been testing 3 and like the changes, so far.
Also I have viewed some of Densming's Tutorials already, just to get me up to speed.

My ETA on 'Lost Prince' has been screwed up cos of work and other issues.
I need to get it finished on 2.72 though cos of the 'lake module'.

I tried to port 'Lost Prince' to AGS 3 to finish it but all Hell broke loose.

Why I'm bothering, I don't know.
It's 'Part 1' and taken me too long to do.

If people like it then I may do 'Part 2'...  That will be written with AGS 3, Though.

EDIT:
I may P.M you at some time, if you don't mind, as I have a game idea that you may like to help with.
I just need to think about it some more before I do.

Jay.
#314
Khris.

Yes. I understand what you are saying. Thank you, again, for your help.
Are you sure you want me to go to 'AGS 3'. I may bug you some more.  ;)

Miglioshin.
Thank you for your help.
Without you my sound wouldn't have played... now it does. :)

Many, Many thanks to you both.

Jay.
#315
Thanks guys.

This is all very interesting, and slightly confusing. ???

So... This is what I have now.

Code: ags

// Owl looks at EGO, left, right and centre.
  
  bool play_owl_hoot = true;

  function repeatedly_execute_always() {

  if (player.Room != 16) return;  // exit function if not in room with eyes.

  Region*rr = Region.GetAtRoomXY(player.x, player.y);
  if (!rr.ID) return;  // player not on region.

  if (rr.ID == 1) {  // Owl looks Left.
    object[1].Graphic = 96;
    play_owl_hoot = true;
  }

  if (rr.ID == 2) {  // Owl looks Right.
    object[1].Graphic = 97; 
    play_owl_hoot = true;
  }
  
  if (rr.ID == 3) {  // Owl looks Down.
    object[1].Graphic = 95;
    if (play_owl_hoot) {
      PlaySoundEx(6, 4);
      SetChannelVolume (4,100);
      play_owl_hoot = false;
    }
  }
} 
// Owl in Cemetary : End.


This, also, works like a charm. I am so pleased. :)

Khris. Am I right in assuming that your code is to be only placed in 'Global script'?
Could Miglioshin's code, though, be placed in the 'Room Script'?

I don't know. I am torn between the two ways of doing this.
Help... Which one is the best way for me?

I really appreciate the help both of you have given me.

Jay.
#316
Hi Miglioshin.

Thank you... wonderfull... Fantastic. :D

That has solved my sound issue.

This is, now, what I have in 'Global Script'.

Code: ags

// Lines beneath are for Owl in Cemetary.

bool play_owl_hoot = true;


function repeatedly_execute_always() {

  if (player.Room != 16) return;  // exit function if not in room with eyes

  Region*rr = Region.GetAtRoomXY(player.x, player.y);
  if (!rr.ID) return;  // player not on region

  if (rr.ID == 1) {
    object[1].Graphic = 96;
    play_owl_hoot = true;
   
  }

  if (rr.ID == 2) {
    object[1].Graphic = 95;
        if (play_owl_hoot == true) {
          PlaySoundEx(6, 4);
          SetChannelVolume (4,100);
          play_owl_hoot = false;
      }
  }

  if (rr.ID == 3) {
    object[1].Graphic = 97; 
    play_owl_hoot = true;
  }
} 

// Owl in Cemetary : End.


I don't know if this is the neatest. But... It works. :)

Thank you, Khris and Miglioshin for your help.

Jay.
#317
Hi Khris.

With your script the eyes now follow the player perfectly.

However. I can't get my sound for when the eyes look down.
I had my sound for this originaly set like so.

Code: ags

PlaySoundEX (6,4);  // sound 6 on channel 4
SetChannelVolume (4,100);  // Channel 4. Volume 100. as the sound file is quiet.


I have the script you gave me placed in 'Global Script' like so.

Code: ags

bool play_owl_hoot = true;


function repeatedly_execute_always() {

  if (player.Room != 16) return;  // exit function if not in room with eyes

  Region*rr = Region.GetAtRoomXY(player.x, player.y);
  if (!rr.ID) return;  // player not on region

  if (rr.ID == 1) {
    object[1].Graphic = 96;
    play_owl_hoot = true;
   
  }
  if (rr.ID == 2) {
    object[1].Graphic = 95;
                             // This is where I need a sound to play.
                             // My sound file for this is called 'sound6'
                             // .Play() won't compile.
    play_owl_hoot = false;

  }
  if (rr.ID == 3) {
    object[1].Graphic = 97; 
    play_owl_hoot = true;
  }
} 


Everything works a treat, except for the sound FX.
If I put my couple of lines in the script, for when the eyes look down, the sound works but plays constantly all the time player is on the region.

Please. Can you see anything I have missed or done wrong?
I probably should have mentioned that this is the last thing I need to do with AGS 2.72. I will then go over to 3. I promise. ;)

Many thanks.
Jay.
#318
Hi Khris.

WOW! :o
That looks fantastic.

This should be just what I need.
I will have to try it out tomorrow, though.
I will let you know how it goes.

I have to say. There are quite a few things here that I haven't used before.
I would like to understand, if it works, how it works.

Thank you for your time, Khris.
Jay.
#319
Hi Peeps.

Ok. I have a room that has a pair of eyes, within a wall, set right in the centre of the screen.
The eyes are made up of three objects. 1-eyes left, 2-eyes right and 3- eyes centre. These are on top of each other so they can be switched on or off.

Now on the walkable area, going across the screen and under the eyes, I have set three regions. 1- left side of room, 2- right side of room and 3- just under eyes.
I you are on the left side of screen, on region 1, the eyes look left. If you are on the right side of screen, region 2, the eyes look right and if you are under the eyes, region 3,
the eyes look down at you and a sound is played, just once.

I have written the script for each of the eyes, objects,  to turn off or on depending on what region the player is standing. I used the 'Player walks onto region' for all three.

This works just how I want it to... However I have come across a problem.

On the right side of the screen is a 'switch', this is a hotspot and has a walk to set which is set to 'eblock' because the player walks up to switch and says things about it.
If you are on the right side of screen and click on the switch, no problem, the eyes are looking at you.
But if you are on the left side of the screen, eyes are looking at you, until you click the switch.
The player then walks across the screen, under the eyes, and to the switch says what he knows about it and then, only after he has finished, does the eyes look at him and plays
the sound.

I know what the problem is. It's because of the bloody blocking but I just can't fix it.
I have tried using rep-execute-always but still no joy.

I am sorry for this long message but I wanted to explain my prob as thoroughly as possible. :-[

What am I doing wrong?
Is there an easier way to achieve what I am trying to do?

Many, Many thanks.
Jay.
 
#320
Khris (muc).

Sorry. I will always know you as 'Khris Muc' my mentor.

Jesus Christ.
Was I right about something?

Have a Happy New Year.

EDIT: NickyNyce. Glad I could help. Have a Happy New Year.
Jay.
SMF spam blocked by CleanTalk