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 - Meistari F

#1
Thank you Crimson Wizard,  it worked!     ;-D Finally can I go forward on this work.  I have never see a code like this before but it worked.

But I made a little adjustment on this code.   It now works perfectly.

Thanks again all!

Case closed!  And feel free if anyone here want that free code  that is  if you want that code for your own game creations.

Code: ags
// room script file
int Secret = 0;

#define POSITION_START_MOVE        0
#define POSITION_CHANGE_GRAPHIC    110
#define POSITION_END_MOVE          310


function room_RepExec()
{
    // If thing is not moving OR if it just went all the way to the right -
    if (!oThings.Moving || oThings.X >= POSITION_END_MOVE) {
        // Move thing back
        oThings.X = POSITION_START_MOVE;
        // Switch to next object's x-ray graphic (set to your sprites accordingly)
        switch (oThings.Graphic) {
            case 1425: oThings.Graphic = 1425; break;
            case 5903: oThings.Graphic = 1427; break;
            case 5892: oThings.Graphic = 1428; break;
            case 5893: oThings.Graphic = 1429; break;
            case 5894: oThings.Graphic = 1430; break;
            case 5895: oThings.Graphic = 1431; break;
                    //... etc
        }
        // Begin moving through x-ray window
        oThings.Move(POSITION_END_MOVE, 157, -3, eNoBlock, eAnywhere);
    }
    // If thing was moving and just passed x-ray window
    else if (oThings.Moving && oThings.X > POSITION_CHANGE_GRAPHIC) {
        // Change from x-ray to normal graphic (set to your sprites accordingly)
        switch (oThings.Graphic) {
            case 1425: oThings.Graphic = 5903; break;
            case 1427: oThings.Graphic = 5892; break;
            case 1428: oThings.Graphic = 5893; break;
            case 1429: oThings.Graphic = 5894; break;
            case 1430: oThings.Graphic = 5895; break;
          
           

            //... etc
        




#2
If you have played Leisure suit Larry 2.   You should see what I meant.  But in one scenery there are luggage coming out one after one another.
And it goes from left to right. 

#3
How? 

I still need help with this. Coding this are really giving me headache.
#4
That code works fine too.

But how am I suppose to change the graphic on the same object again 12 times when it is sliding on the same region?

The luggage are 6 and it must go in x-ray first and come out as a normal luggage on the  slider.

The region 4 is where the graphic change into luggage.   

And on the Region 2 is where the X-Ray images of the luggage goes through.
#5
Hi all.

I have again problem with a very difficult code.



As you can see from this image from Leisure Suit Larry 2.  The Luggage slides from left to right.
When it on the region where the x-ray window it shows a x-ray  image sprite.  When it slides out it shows the luggage and it continues to slide right.
And then it begins from the start, sliding another x-ray sprite image on the slider and another luggage image appears too when it comes out of from the x-ray window.
I hope you understood me.

I have two region for this.  Region 2 and Region 4. 

When the object is on region 2 I want to change the image of the graphic.
And again when it slides on region 4.


In First Loading screen my code is:

Code: ags
SetTimer(1,275);


Here is my code.

i
Code: ags
 function room_RepExec()
{

oThings.X= -50; oThings.Y=158;

if (!oThings.Moving){
oThings.Move(310, 157, -3, eNoBlock, eAnywhere);
}

/////This code lets the object slide from right to left endless.



Region* Taska1 = Region.GetAtScreenXY(oThings.X, oThings.Y);
if (Taska1 == region[4]) {  
    oThings.Graphic=5903;
    SetTimer(1, 175);
   }
if (Taska1 != region[4]) { 
if (IsTimerExpired(1)){
    oThings.Graphic=1425;
    SetTimer(2, 800);
}
}
}
  


This code works!  The graphic changed in each times the object slides on Region 4 and when it is off the Region 4.

And it continues to move from left to right. And it returns back on the same spot where the object start to move from left to right.

But the problem is I want to change the graphic again 12 times when it goes on same region 4

I hope you can help me with this because this is so difficult for me.


I also tried this code.



Code: ags


 function room_RepExec()
{

oThings.X= -50; oThings.Y=158;

if (!oThings.Moving){
oThings.Move(310, 157, -3, eNoBlock, eAnywhere);
}


if (IsTimerExpired(2)){
  SetTimer(1, 0);
   oThings.Graphic= 1429;
    SetTimer(3,  275);
}
else if (IsTimerExpired(3)){
      SetTimer(2, 0);
        oThings.Graphic= 5894;
    SetTimer(4,  800);  



That code worked great until I found out about this in Help section:   There are 20 available timers, with TIMER_IDs from 1 to
So I could add more Settimer.  I hope that will be changed in the next update.

edit......
Thanks to Crimson Wizard he solved this for me.  Case Closed.


Code: ags
// Set these according to your game
#define POSITION_START_MOVE         0
#define POSITION_CHANGE_GRAPHIC 100
#define POSITION_END_MOVE            310
 
function room_RepExec()
{
    // If thing is not moving OR if it just went all the way to the right -
    if (!oThing.Moving || oThing.X >= POSITION_END_MOVE) {
        // Move thing back
        oThing.X = POSITION_START_MOVE;
        // Switch to next object's x-ray graphic (set to your sprites accordingly)
        switch (oThing.Graphic) {
            case 1001: oThing.Graphic = 1100; break;
            case 1101: oThing.Graphic = 1200; break;
            case 1201: oThing.Graphic = 1300; break;
            //... etc
        }
        // Begin moving through x-ray window
        oThings.Move(POSITION_END_MOVE, 157, -3, eNoBlock, eAnywhere);
    }
    // If thing was moving and just passed x-ray window
    else if (oThing.Moving && oThing.X > POSITION_END_MOVE) {
        // Change from x-ray to normal graphic (set to your sprites accordingly)
        switch (oThing.Graphic) {
            case 1000: oThing.Graphic = 1001; break;
            case 1100: oThing.Graphic = 1101; break;
            case 1200: oThing.Graphic = 1201; break;
            //... etc
        }
    }
}





#6
Quote from: Nergal on Tue 26/05/2020 09:48:13
Thanks a lot for your comment, Fribbi. I'm really glad you had a good time playing it.

Wow, it seems our dear Dery Marlon have a twin in Iceland. I could never have imagine that!  :cheesy:

You are welcome. 
Yes Gudjon Valur was the first man which came into my mind when I saw the main character. 
He really looks like him. He  has actually retired from handball now as a handball player. But he is now training a handball team in Germany.



#7
I have finish this game. I recommend to all gamers to download this wonderful well designed game.
I left my comment on the game database for you.   (nod)

The main character reminds me on one of famous Icelandic handball player Gudjon Valur



[imgzoom]https://m2.mbl.is/f93IDw39qqgDwJCsU2aK-qpnAeA=/1640x1093/smart/frimg/1/15/59/1155949.jpg[/imgzoom]
#8
Thanks so much again for this Khris. I knew I could count on you again.

And please stay safe and healthy from that evil Corona virus. You are one of the most useful smartest man and a true legend on AGS Forums.

Amen!  I promise I will mention you in the credit list as my thanks to you in my game when I finally have completed it.
#9




Hi again Khris.

In last time you helped me with the code how to pick a random 6 numbers.
Right now I need to know how to pick the right 6 numbers.

The right 6 numbers are random numbers.

What I have done so far is this.

Code: ags
function cReceptionist_UseInv()
{

if (Region.GetAtRoomXY(player.x, player.y) == region[2]) {
if (cLarry.ActiveInventory == iLottoticket){
gDisplay.SetPosition(25, 55);
gDisplay.Visible = true;
BPicture.NormalGraphic = 11;

 LTexti.Text = "\"Say,\" you ask the receptionist, \"is this lottery ticket any good?\"";
}
}
}


Code: ags
else if (cLarry.room == 17){
  int tala1=Random(999);
   int tala2=Random(999);
    int tala3=Random(999);
     int tala4=Random(999);
      int tala5=Random(999);
       int tala6=Random(999);
gDisplay.Visible = false;
DisplayAt(63, 50, 210,  "\"I don't know,\" she replies, \"I've misplaced my glasses! As best I can remember, this week's Lucky Life[Lottery Luck-O Buck-O numbers[are: %d,%d,%d,%d,%d, and %d.[What six numbers do you have?\"",tala1, tala2, tala3, tala4, tala5, tala6);
gNumberPicks.Visible = true;


Code: ags

else if (cLarry.room== 17){
  
   int tala1=Random(999);
   int tala2=Random(999);
    int tala3=Random(999);
     int tala4=Random(999);
      int tala5=Random(999);
       int tala6=Random(999);
  String input = TNumbers.Text;
  int t = input.AsInt;
  if (t > 0 && t < 1000) {
    numbers[pick] = t;
    pick++;
    if (pick == 6) {


 gNumberPicks.Visible = false;
      gLottoMachine.SetPosition(90, 75);
      gLottoMachine.Visible =false;


if (tala1 && tala2 && tala3 && tala4 && tala5 && tala6== Random(999)){

   
   Display("Right");   //If all numbers was correctly picked. 
   }
  
  

 else{

      Display("Wrong."); //If the player typed wrong number.
         
      gNumberPicks.Visible = false;
      gLottoMachine.SetPosition(90, 75);
      gLottoMachine.Visible =false;
 
 }
 

      
      
      
    }
    else {
      Picks.Text = String.Format("Pick #%d", pick + 1);
      TNumbers.Text = "";
    }
 }


  
  else Display("Please enter a number from 1-999");


}
}




The problem is  the message Yes appears  only when I pick both right number and wrong number.

Khris or anyone, please I help with this.


#10
Congratulation to all nominated game designers.  Unfortunately, I had to pass thosel games that were for sale when I was voting.  But anyway I wish you all good luck
#11
Yes I know. But it is still good that I warned people about this right?
Or maybe you already knew that. 
Just be careful when you are going to click on threads with unsafe or bad links. :)



#12
I am  not blaming the AGS forums. I know AGS forums are ok.
I just find it strange when I get this bad connection warnings if I click on some older threads.

When I was on page 2 and 3 on this page I got no warnings. But I get warning when I am on page 1 on this thread. So maybe it is the links that person are sharing which is causing this.

https://www.adventuregamestudio.co.uk/forums/index.php?topic=56502.0


Thanks again for the reply.

#14
Quote from: AGA on Tue 18/02/2020 13:14:42
I've fixed the issue that was preventing editing.  Users can't delete their own games regardless, so it would have required a game game admin's input!

Thanks.  Another question.

Why am I getting a bad link connection errors warnings from my virus internet security protection (McAfee) when I visit some of the old forum pages?

Are these pages not safe anymore?
#15
Quote from: cat on Tue 18/02/2020 11:05:37
I disabled the game, now it is not visible in the database anymore. I hope this is what you wanted to achieve. I was also not able to edit the game, with the same error message you got.

Thanks.  I could not edit my game page because I got this strange error. Because I thought my game section was damaged,  I needed to delete that game section or get it fixed. I deleted the demo because I need to fix it. I'll upload the demo again as soon as it get fixed.
#16
Hi. Can someone delete my game section for me.

https://www.adventuregamestudio.co.uk/site/games/game/2407-leisure-suit-larry-1-ega-icelandic/

I was going to edit it but I always get now this error.


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /var/www/adventuregamestudio.co.uk/public_html/pages/game/add_or_edit.php:174 Stack trace: #0 /var/www/adventuregamestudio.co.uk/public_html/pages/game.php(20): require_once() #1 /var/www/adventuregamestudio.co.uk/public_html/index.php(103): require_once('/var/www/advent...') #2 {main} thrown in /var/www/adventuregamestudio.co.uk/public_html/pages/game/add_or_edit.php on line 174
#17
Khris you are the coolest and the smartest guy I know from AGS forums.
But that code worked perfectly.
Thank  you!

I also hope any others game designers  will find this code useful too for their own game. :)
#18
I am now trying to write a code for player, when he needs to pick a 6 numbers.

When that happens a  game.inputbox appear where he needs to write numbers.

The player must insert only a numbers in that text box from 1-999 in that ,not letters.

What is the code to do that,  if I want player write only a numbers and avoid letters in that game text box?

Let say if the player write letters instead for numbers, I want to display 
Code: ags
Display"Sorry, you must only write numbers";


Help!
#19
Hahaha

I found it out how to do this.

And here is the solution if any of you want the code.

 
Code: ags
Overlay* myOverlay = Overlay.CreateTextual(100, 20, eFontNormal, Game.NormalFont,0, "Hello who are you?");
Wait(40);
Display("What is your name?");

myOverlay.Remove();


Case closed.
#20
Does any of you know the code for displaying  2 messages in same time in the game?  Or is that not possible?

What I mean I don't want the second message display after the first message. I want the second to appear with the first message together in same time.

Display("Hello, Who are you?");
Display("What is your name?");


SMF spam blocked by CleanTalk