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

#1
Hints & Tips / Re: Dreams in the Witch House
Sat 01/07/2023 16:54:45
Have you managed to explore other areas in the game before getting tired or sick? I am stuck at the beginning of the game with trying to tackle the exam, have a date with a student, needing to finish job to make money, getting tired or sick, trying to sleep, etc.
#2
Quote from: Mandle on Tue 27/06/2023 23:14:13
Quote from: xboxown on Sun 18/06/2023 06:37:00Though I can say I finally finished the game. A masterpiece game that one.

Great to hear. It is an amazing game! It was my honor to do the copy-editing on the text, and I was also the voice of Thrym the ice giant, which was great fun to do.

Coool!!! You did a superb job man!!!

I need voice actor for my game when it is finished. :D
#3
Quote from: Matti on Fri 23/06/2023 18:52:12A baseline which is set to 0 is automated, meaning it's set at the bottom of the object. Any other value than 0 is the y-coordinate on the screen, so if you set it to 1, it will be at the top of the screen.

Edit: My guess is that you think that a positive or negative number moves the baseline up or down, which is not how it works.

OOOH!!!
#4
  Hello,

I have one little issue where the object (item) is above the player instead of underneath it. I saw the baseline as value which determine between behind or above. So, it started with 1 if I go below to 1 it cancels the baseline and become automatic instead of manual. If I go higher than 1 it goes even above the player. Any advice?
#5
Hmmmm....it fixed the run-time error. But it still did not move.

Code: ags
oStalagmiteTip.Move(oStalagmiteTip.X, 1000,10,  eNoBlock, eAnywhere);
#6
OOOH! Speed?! I didn't know that! Thanks for the tip!
#7
I did. It gave me an error that I added an extra parameter block that does not exist with object. Here let me show you the error message via screenshot:


#8
Aaah! Actually it is under repeated exec:




function room_RepExec()

This the entire code in case I made a bug somewhere.

Code: ags
function room_RepExec()
{
  if (!SeaMonsterAttack)
  {
    // Not close to the monster
    cTentacle.x = cSeaMonster.x - 47;
    cSecondTentacle.x = cSeaMonster.x + 57;
    if (IsTimerExpired(1)) {
      int newX, diff;
      do {
        newX = Random(160) + 40; // range 40 - 200
        diff = newX - cSeaMonster.x; if (diff < 0) diff = -diff;
      } while (diff < 30); // move by at least 30 pixels
      cSeaMonster.Move(newX, cSeaMonster.y, eNoBlock, eAnywhere);
      SetTimer(1, (Random(5) + 5) * GetGameSpeed()); // 5 - 10 seconds
    }
  }
  else if (SeaMonsterAttack)
  {
    if (!oStalagmiteTip.Moving)
    {
      cSeaMonster.Say("ROOOAAARR");
      // swing tentacle
      cRobotLE.Say("Eeeeeek!!");
      cRobotLE.Walk(cRobotLE.x,  cRobotLE.y+24, eBlock, eWalkableAreas);
      // Close to the monster
      cSeaMonster.LockView(VWROARINGMONSTER);
      cSeaMonster.Animate(false,  5, eOnce);
      cSeaMonster.UnlockView(eStopMoving);
      cTentacle.LockView(VWRAISINGTENTACLE);
      cTentacle.Animate(false,  15, eOnce);
      cTentacle.UnlockView(eStopMoving);
      cSecondTentacle.LockView(VWRAISINGTENTACLE);
      cSecondTentacle.Animate(false,  20, eOnce);
      cSecondTentacle.UnlockView(eStopMoving);
      cTentacle.y=cTentacle.y+48;
      cTentacle.LockView(VWSWINGTENTACLE);
      cTentacle.Animate(false,  20, eOnce);
      cTentacle.UnlockView(eStopMoving);
      cSecondTentacle.y=cSecondTentacle.y+48;
      cSecondTentacle.LockView(VWSWINGTENTACLE);
      cSecondTentacle.Animate(false,  25, eOnce);
      cSecondTentacle.UnlockView(eStopMoving);
      cSecondTentacle.y=cSecondTentacle.y-48;
      cTentacle.y=cTentacle.y-48;
   // if (cTentacle.x>=75 && cTentacle.x<=85)
    //{
      // Here monster dies and be replaced with a body log.
     // Display("The tentancle damages the frail ....");
   // }
    }
   int dist = cTentacle.x - (cStalagmiteTip.x+ Game.SpriteWidth[cStalagmiteTip.Frame] / 2);
   if (dist < 0) dist = -dist;
  // Display(String.Format("%d", dist));
   if (dist<10) { // adjust these numbers, replace 123 with proper Y coordinate
    Display("Uh oh...look like that tentacle hit something it should not have hit!!");
    oStalagmiteTip.Move(oStalagmiteTip.X, 1000, eNoBlock);
    }
    // tip reaches water
    if (oStalagmiteTip.Y >= 200) {
      oStalagmiteTip.StopMoving();
      oStalagmiteTip.Visible=false;
      //cStalagmiteTip.ChangeRoom(1, 0, 0, eDirectionDown);
      Display("The stalagmite falls and sinks into the ocean. The monster shrieks in pain....");
      cSeaMonster.LockView(VWROARINGMONSTER);
      cSeaMonster.Animate(false,  5, eOnce);
      cSeaMonster.UnlockView(eStopMoving);
      
    }
  }
}

#9
I understood what Khris was doing. Add a new object and then use the object for the room. I just checked youtube and learned now how to add object.

I did and reused his code again:

Code: ags
if (dist<10) { // adjust these numbers, replace 123 with proper Y coordinate
    Display("Uh oh...look like that tentacle hit something it should not have hit!!");
    oStalagmiteTip.Move(oStalagmiteTip.X, 1000, eNoBlock);
    }
    // tip reaches water
    if (cStalagmiteTip.y >= 200) {
      oStalagmiteTip.StopMoving();
      oStalagmiteTip.Visible=false;
      //cStalagmiteTip.ChangeRoom(1, 0, 0, eDirectionDown);
      Display("The stalagmite falls and sinks into the ocean. The monster shrieks in pain....");
      cSeaMonster.LockView(VWROARINGMONSTER);
      cSeaMonster.Animate(false,  5, eOnce);
      cSeaMonster.UnlockView(eStopMoving);
      
    }
  }

Problem now..the thing does not move at all. I don't know what mistake I made here.
#10
Quote1. please do not quote the entire post; you can click the Reply button at the bottom.

Apologies for that. Not doing it again.

Quote2. in my code, oStalactite is an Object, not a Character. Please show your code and error messages as they appear, ideally verbatim.

OK...this is the source code modified:

Code: ags
int dist = cTentacle.x - (cStalagmiteTip.x+ Game.SpriteWidth[cStalagmiteTip.Frame] / 2);
   if (dist < 0) dist = -dist;
  // Display(String.Format("%d", dist));
   if (dist<10) { // adjust these numbers, replace 123 with proper Y coordinate
    Display("Uh oh...look like that tentacle hit something it should not have hit!!");
    cStalagmiteTip.Walk(cStalagmiteTip.x, 80, eBlock, eAnywhere);
    }
    // tip reaches water
    if (cStalagmiteTip.y >= 64) {
      cStalagmiteTip.StopMoving();
      cStalagmiteTip.ChangeRoom(1, 0, 0, eDirectionDown);
      Display("The stalagmite falls and sinks into the ocean. The monster shrieks in pain....");
      cSeaMonster.LockView(VWROARINGMONSTER);
      cSeaMonster.Animate(false,  5, eOnce);
      cSeaMonster.UnlockView(eStopMoving);
    }

I couldn't make it invisible so I decided to make a void room and just the unwanted characters there where the player can never visit as means of destroying them.

Quote3. once again: the code might not work as-is and is primarily meant to show a way how this can be done in general; there's no way around studying the manual and familiarizing yourself with the AGS scripting language.

Yeah, for sure, I can read the manual. If I am stuck though, I will post here in hopes great people like you :D well take their time to help me out. But you are right, I should read the manual and try hard to figure it out on myself first. Best to way to learn, right?

Thank you so much for helping me and replying my to plea. I appreciate your time and effort, especially since it is coming out of your time to helping a stranger like me.
#11
Quote from: Khris on Wed 21/06/2023 06:31:51First of all, you don't need to use a (global) character for everything. Rooms have (local) objects, so unless you need walking animations, those are fine.

Next, you can do a simple coordinate check. Since the tentacles only move sideways, you only need to compare the x coordinates of the tentacle and the stalactite.

Again inside repeatedly_execute:

Code: ags
  int dist = cTentacle.x - (oStalactite.X + Game.SpriteWidth[oStalactite.Graphic] / 2);
  if (dist < 0) dist = -dist;
  if (dist < 20 && oStalactite.Y == 123) { // adjust these numbers, replace 123 with proper Y coordinate
    oStalactiteTip.Move(oStalactiteTip.X, 10000, eNoBlock);
  }
  // tip reaches water
  if (oStalactiteTip.Y >= 250) {
    oStalactite.StopMoving();
    oStalactite.Visible = false;
  }
Objects are positioned using their bottom left corner, so we add half the sprite width to get to the center and compare that to the tentacle by checking whether the difference is below a threshold.

As for the piece breaking off, just start with the stalactite already in pieces. This way you simply need to move the tip object down and not replace anything.

(once again the code might now work as-is and is primarily meant to show a way how this can be done in general)


Visible and graphics are producing error. There is no way of making the character disappear as a command.
#12
You are genius! I wish I thought of it like that! It is even more realistic this way! Thank you!
#13
  Hey guys,

I have one other question to ask. I want when the tentacle collides with the player it is considered game over. The player is crushed and dies out. How do I make the collision detection for that? Another thing, how do I replace a character in the map, add another character in the map and make that new character after reaching its destination disappear and be removed from the map?

I will explain. I have a Frail Stalagmite. It comes into two part. One is the full frail stalagmite, once the tentacle hits it, the full stalagmite is replaced with broken stalagmite one and another piece is added and falls down to the water and disappears once it hits the water.
#14
I removed Math from .Random and it works beautifully! THANK YOU FOR THIS AMAZING SOURCE CODE! THANK YOU THANK YOU THANK YOU! You did it! I appreciate all your help! THANK YOU!
#15
But math does not support random.
#16
I ran the code and I got this error message

#17
There is a bug in this line of code:

Code: ags
 SetTimer((Math.Random(5) + 5) * GetGameSpeed()); // 5 - 10 seconds

room3.asc(73): Error (line 73): Not enough parameters in call to function


There where other bugs as well. I changed the code to like this:

Code: ags
cTentacle.x = cSeaMonster.x - 47;
  cSecondTentacle.x = cSeaMonster.x + 57;
  if (IsTimerExpired(1)) {
    int newX = cSeaMonster.x;
    // move at least by 30 pixels
    while (newX - cSeaMonster.x < 30 || cSeaMonster.x - newX < 30) {
      newX = Random(160) + 40; // range 40 - 200
    }
    cSeaMonster.Move(newX, cSeaMonster.y, eNoBlock, eAnywhere);
    SetTimer((Random(5) + 5) * GetGameSpeed(), 1); // 5 - 10 seconds
    
  }

However, I don't know how to solve the last bug with the SetTimer saying not enough parameter.
#18
Thank you guys so much! I will implement the code today and try it out.
#19
     Hello guys,

I need help in a basic scenario for me. I have a sea monster with two tentacles one on the left and one on the right. Their position is as follow:

Main monster head: 103, 107
Right tentacle: 158,111
Left tentacle: 56,112

This is the current code for the monster moving to the right:

Code: ags
if (!cSecondTentacle.Moving)
    
    cSecondTentacle.Move( 238, cSecondTentacle.y, eNoBlock, eAnywhere);
  if (!cSeaMonster.Moving)
  
    cSeaMonster.Move(190, cSeaMonster.y, eNoBlock, eAnywhere);
  if(!cTentacle.Moving)
   
    cTentacle.Move(145, cTentacle.y, eNoBlock, eAnywhere);

Right now the speed of the monster is super fast. How do I slow it down correctly? Second of all, how do I make it that monster move randomly between 0 to 238 with their tentancles and body in corrent distance between each other. i want it..when it reaches a certain waypoint or point it stops for like 5 seconds before picking another random position to go too. thanks in advance.
#20
Hmmm. Excellent question. I need to ponder a little bit on this question.

I would say I didn't understand your hint and running toward "I completely forgot about the game and have no idea what I'm saying what I did."

It is truly hard to favor one of the other when I am split in both directions.

Though I can say I finally finished the game. A masterpiece game that one.
SMF spam blocked by CleanTalk