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

#1
AGS Games in Production / Re: SALARYMAN
Sat 02/11/2019 02:12:32
Here's the link to Ruin's AGS page, the link is halfway down.

https://www.adventuregamestudio.co.uk/forums/index.php?topic=54697.msg636558623#msg636558623

Edit: The link appears to be dead. I'll look into uploading it somewhere else soon! Sorry.
#2
AGS Games in Production / Re: SALARYMAN
Fri 01/11/2019 15:07:04
Hey all - just letting you know I have started a video devlog for Salaryman - first post has been edited to include this. Hope you're all doing well. Give me a click and follow if you have five minutes, I'd appreciate it. Cheers!

#3
AGS Games in Production / Re: SALARYMAN
Thu 11/04/2019 05:40:09
Salaryman now has some social media pages, where I will be posting regular updates and silliness. Original post has been edited to include the links. Check me out on twitter, itch and gamejolt. Cheers!
#4
AGS Games in Production / Re: SALARYMAN
Fri 05/04/2019 15:13:24
Quote from: selmiak on Fri 05/04/2019 11:02:00
as ugly as the main character looks, he is totally fitting for the overall style of the game and the trailer makes it appear as a fun game! Keep us posted plz! ;-D

Ugly?! He's considered classically good looking where he is from. The arrangement of his head pipes is the height of sophistication.

Thanks for the comments guys!
#5
AGS Games in Production / SALARYMAN
Fri 05/04/2019 07:52:51


When every day is the same - work, sleep, work, sleep - don't you want to break the cycle and just drop a vending machine on someone?




Salaryman is my upcoming, mostly done, almost-definitely-will-be-finished return to the wonderful world of AGS.

Guide our potato-headed hero back to his loving family across a crooked world filled with weird characters who will help or hinder you depending on how you treat them.

Multiple puzzle solutions, different paths to different endings and optional/hidden areas!

Slapstick fun abounds, with minigames and secrets, and a whole heap o' retro fun. One click interface - no verb tables! Textless and intuitive - no language barriers!

Stands at roughly 70% done right now. Probably out around June/July 2020.

Have a look at the trailer, and I welcome your feedback. Hope you're all having a good day! Don't work too hard...

I'm also dipping my foot into social media for this one, here are two for a start. Give me a follow/likes and so on if you can! Not much there at the moment but there will be soon...
https://twitter.com/salarymangame
https://duckbutcher.itch.io/salaryman-a-darkly-funny-point-and-click-adventure
https://gamejolt.com/games/salarymangame/407172








Edit November 1st - I have started a developer's vlog for this game! Have a look and please do give me a like or subscribe if you have a minute to spare. Cheers!

#6
Quote from: Khris on Mon 31/12/2018 09:45:59
You're going to need x and y distance first:
Code: ags
  int dx = cFish.x - player.x;
  int dy = cFish.y - player.y;


According to the theorem, the distance between player and cFish squared is dx² + dy². Accordingly:
Code: ags
  if (dx * dx + dy * dy < 20 * 20)  // distance is less than 20 pixels


Got this working great, with a couple of adjustments! Thanks as always Khris, this was more or less exactly what I was after.
#7
Khris, thanks for the shortcut on those initial loops, that's made things a lot simpler and less cluttered.

Quote from: Khris on Sun 30/12/2018 13:18:23

Code: ags
  int x = player.x, y = player.y - 20; // base offset
  if (player.Loop == 0) y -= 10;  // down
  else if (player.Loop == 3) y -= 50;  // up
  else if (player.Loop == 1) x -= 40;  // left
  else x += 40;  // right


Now you can use the Pythagorean theorem to calculate the distance between the player's mouth base coords and another fish's base coords.
If distance < x, small fish collides with mouth.

Yeah sorry, you lost me at Pythagorean Theorem I'm afraid! Can you throw me a quick example? Thanks for your time as always.
#8
Quote from: eri0o on Sat 29/12/2018 07:13:15
The easier way would be breaking the bigger fish sprite in two, head and rest.

Actually thought of doing this - using "follow exactly" -  I'm considering it as a last resort if I can't get anything else working as it'd necessitate me redrawing a bunch of art. Cheers for the suggestion!

Slasher, could you elaborate? As I understand it this would involve checking coordinates on the sprite itself rather than the room/screen? Apologies if this is a dumb question.

Quote from: Cassiebsg on Sat 29/12/2018 09:00:38
Or check which loop your fish is facing and only eat if the loop is facing the small fish... which might end up having to check loop and y position for the fishes... but should work fine.  (nod)

This makes sense, I'll have a try!
#9
Hey all, hope you had a good Christmas.

I'm doing a sub-game in which the player controls a big fish swimming around which has to eat smaller fish. It does this by running into them. This is my code for the collision:

Code: ags

if (cEgo.IsCollidingWithChar(cfish)){

  if (cEgo.Loop == 0){ //if facing direction, eg down
    player.ChangeView(194);//change to bite anim
    player.Animate(0, 1, eOnce, eBlock);//play bite anim
    player.ChangeView(101);//returns to original view
  }
    
  if (cEgo.Loop == 1){
    player.ChangeView(194);
    player.Animate(1, 1, eOnce, eBlock);
    player.ChangeView(101);
  }
  
  if (cEgo.Loop == 2){
    player.ChangeView(194);
    player.Animate(2, 1, eOnce, eBlock);
    player.ChangeView(101);
  }
  
  if (cEgo.Loop == 2){
    player.ChangeView(194);
    player.Animate(2, 1, eOnce, eBlock);
    player.ChangeView(101);
  }
  
  cfish.ChangeRoom(-1); //fish disappears



It works fine.

HOWEVER - fishes usually just eat through their mouths and as you can probably guess this interaction plays no matter what part of the big fish sprite my little fish come into contact with.

So here's the question - is there some way to have this interaction only play when the little fish collide with the head area of my big fish? Sort of like assigning a hotspot or region to the sprite.

Thanks for your time, hope you're all having a good one.
#10
So I had a bit of a tinker with this again today. Thanks for the corrections dayolron and thanks again Monsieur for the clarification, though I was more apologising for my inevitable questions! That makes everything a lot clearer, appreciated.

I've changed a couple of things, including changing a projectiles[p].c.Visible=true; to projectiles[p].c.on=1; as (I think) characters have to be turned on and off like this rather than with .Visible=.

I've also hit another snag, regarding this bit:

Code: ags

//Update projectiles location at each screen refresh
void MoveProjectiles()
{
 
  for (int p=0; p<MAX_PROJECTILES; p++) {
        if(projectiles[p].inUse) { //in use
          //Our accurate locations, in float
          projectiles[p].x+=Maths.Cos(projectiles[p].angle)*PROJECTILE_SPEED;
          projectiles[p].y+=Maths.Sin(projectiles[p].angle)*PROJECTILE_SPEED;
          
          //Our on-screen locations, in pixels (rounded from the float value)
          projectiles[p].c.x = FloatToInt(projectiles[p].x);
          projectiles[p].c.y = FloatToInt(projectiles[p].y);
        }
  }
 
}


Error is '.angle' is not a public member of 'ProjectileStruct'.
#11
Monsieur, looks like you put in a lot of work there, thanks. And regarding the follow character command, this was how I was masking the projectile - hiding it behind the player character ready to be called to move. I guess it does seem a bit daft but I was making it up as I went along.

Regarding your code, it's way beyond my current level of understanding and while I can understand the general gist, I've put it into my game and got a couple of errors. Float angle = 0 under void makeprojectile throws up a “can't convert int to float” error, and after pulling bits of the code apart to see how they work in isolation I also get an error that “math” is undefined. At the moment everything is at the top of global script, so if it needs to be anywhere specific please let me know.

Thanks for your time, appreciate it.
#12
I'm open to suggestions, if there's a better way to tackle this situation I'm all ears. I've never attempted to do something like this before and as ags isn't really set up for this kind of game I kind of just threw stuff at the wall to see what would stick..!
#13
Hey people, hope you're all well.

I'm playing about with a keyboard controlled top down shooter sort of game. Arrow keys to move and space to fire so far.

I'm using a character (cfire) as the projectile, and have this character binded behind the player character using FOLLOW_EXACTLY.

Upon pressing the space bar, the game checks which direction the character is facing and moves the projectile 50 degrees away from the character in the appropriate direction. There is a short timer which allows the projectile to achieve this distance before respawning behind the player character for the next shot. It works pretty good.

My problem is I have to repeatedly hammer the space bar in order for this to work - holding the spacebar produces some odd effects, ie the projectile slowing to aãâ,¬â,¬snail's pace before stopping suspended in the air. Ideally I don't want to give my players broken wrists, so if there's a simple way to have the projectile fire at a steady rate while holding the spacebar down, I'd be really grateful if you could let me know! I suspect the problem may be something to do with the timer but I'm not sure what to do.

Here's the code, from globalscript function on keypress.

Code: ags


  // FUNCTION KEYS AND SYSTEM SHORTCUTS
  
  if (keycode == eKeySpace){
   cfire.FollowCharacter(null);
   if (player.Loop==2){
   cfire.FaceDirection(eDirectionRight);
   cfire.Move(cego.x+50, cego.y+0, eNoBlock, eAnywhere);
   SetTimer(1, 6); 
   }
   if (player.Loop==1){
   cfire.FaceDirection(eDirectionLeft);
   cfire.Move(cego.x-50, cego.y-0, eNoBlock, eAnywhere);
   SetTimer(1, 8); 
   }
   if (player.Loop==0){
   cfire.FaceDirection(eDirectionDown);
   cfire.Move(cego.x+0, cego.y+50, eNoBlock, eAnywhere);
   SetTimer(1, 8); 
   }
   if (player.Loop==3){
   cfire.FaceDirection(eDirectionUp);
   cfire.Move(cego.x-0, cego.y-50, eNoBlock, eAnywhere);
   SetTimer(1, 8); 
    }
  }


And here is the timer check in global rep- ex.

Code: ags

  if (IsTimerExpired(1)){
   cfire.x=cego.x;
   cfire.y=cego.y;
   cfire.FollowCharacter(cego, FOLLOW_EXACTLY, 1);
   return;
  } 
#14
Hey hey, hope you're all well.

Im using the Sierra template and I'm having some bother with my cursor image when mouseovering a hotspot or object when an inventory item is active. Basically I have an alternative cursor sprite for each inventory item which I want to appear when a useable object or hotspot is mouseovered with an active item. Is there a way to do this globally without putting in code for each individual hotspot or object?

Thanks.
#15
Yeah, you got me Khris, apologies. Same as I said but check ==1 before rather than ==2 should work. Checking ==2 would work if you were doing your action in rep ex. Live n learn.
#16
Create a global variable, let's call it “defeated” as per your description, but you can call it whatever you want. Set its default value to 0.


In “player enters room”, put

defeated+=1;

This will add one digit to the variable whenever the player enters. So when you enter the second time the variable will be 2.

Above this, also in player enters room, put

if (defeated==2){

and then what you want to happen. Important - after you've done what you want to happen, make sure to add another value to the variable, eg

defeated=3;
}

This will ensure the action isn't repeated.

Apologies for lack of code formatting, on my phone :)
#17
Could you be more specific? I've played about with if (player.frame==whatever) etc but can't get the results I'm after. I don't know how to have the game “wait” in terms of frames rather than game loops. Let me know if you can, thanks a lot!

Edit: scratch that, I sorted it! Thanks for getting me started!
#18
Hey all, hope you're well. I have a problem.

I'm doing trampoline based puzzle. When my character gets on the trampoline, he bounces up and down as an idle animation. The player can then select various hotspots for him to jump to, at which point a specific blocking animation will play showing him jumping from the trampoline to the particular hotspot.
The problem is of course that the new animation interrupts the idle animation no matter what frame it's on, so I get a jarring effect of my character jumping “mid jump” rather than from the trampoline.

Is there any way to get the game to run to the end of the current loop (ie when he lands back on the trampoline) and then play the next animation?
#19
Ah right, yeah I was using the default setting. I'll look into the custom inventory handling. Would this also apply to clicks on an "empty" inventory window slot, ie a click on blank space? Basically I want the right click to shut the inventory wherever the right mouse is clicked.

Thanks for pointing me in the right direction!
#20
Hey everyone, hope you're all doing well.

I have a sierra style inventory GUI which starts invisible and appears with a right-click. I've used some code which works fine, which tells the engine to make the window appear with a right click, and then disappear with another right click, simple and efficient. Here's the code in full, in function mouse click in the global script.

Code: ags

//yada yada left click functions

else if (button == eMouseRight) { //if right button is pressed
     if (gInventory.Visible == true) { 
       gInventory.Visible = false; //if the gui is visible, turn it off - note this should happen in all situations if the GUI is visible!
       
     } 
        if (player.ActiveInventory){  //if the player has an active item
        player.ActiveInventory = null; // gets rid of it
        mouse.Mode = eModeInteract;   //changes the pointer back to default
        }
        else gInventory.Visible = true; //otherwise, turn the inventory window on



So here's my problem. I open my inventory, select my item and right click out, closing the window, BUT only when I click on the GUI background image, or outside the GUI itself. If my pointer is in the actual inventory window (ie where the item icons are selected), it doesn't respond to a right click at all and I have to move it out of the box in order to shut the GUI. I'd really like to solve this problem for a little more fluidity and consistency!

Can anyone help me out?
SMF spam blocked by CleanTalk