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

#2641
Also: I just realized that, when I open the inventory and select an item, the inventory closes. That's okay by me.

Then, when I move my mouse back to the top of the screen to open the inventory GUI, the mouse cursor changes back to normal, even though I can still use the item I selected earlier on other items in the inventory and player.ActiveInventory is still correctly set.

Why does the cursor graphic have to go back to default setting when I open the GUI? Why does that happen?

I don't get this GUI business  >:(
#2642
I wish it was something so simple:
#2643
"Handle inventory clicks in script" is set to false, so my inventory script is... nonexistent, really. I'm working on my first GUI here.
Right clicking on an item in the inventory runs the "look" script and left click runs the "interact" script that is set to the item. That much works without a hitch.

In the global script file I have these, and they work ok.

Code: ags

function iTemB_Look()
{
cEgo.Say("It's a round peg");
}

function iTemA_Look()
{
cEgo.Say("There is a round hole in this piece of wood");
}

function iTemA_UseInv()
{
if (cEgo.ActiveInventory == iTemB) {
  cEgo.Say("It fits!");
  player.LoseInventory(iTemB);
  player.LoseInventory(iTemA);
  player.AddInventory(iTemC);
}
}


If I righ-click on the items A or B, I get the correct cEgo.Say lines for examining the items.
If I left-click on an item, the cursor graphic changes correctly, and by left-clicking 'iTemB', reopening the inventory and left-clicking on iTemA combines the items and I end up with iTemC in my inventory. As far as I understand, the player.Active.Inventory has to have been correctly set for this to work.
But as I explained in my forst post, for some reason the moment I click on a character or a hotspot, the game forgets I even tried to use an inventory item on them.

Code: ags

function cSidecharacter_Look()
{
cEgo.Say("That looks like sir Wellington on Hamshire");
}

function cSidecharacter_Talk() // After selecting an item in inventory, this script is still run!
{
  cEgo.Say("I think you look silly, sir");
  cBaddie.Say("No, dear sir, I believe it is YOU who looks silly!");
  cEgo.Say("Jolly good, sir!");
}
}

function cSidecharacter_UseInv() // This NEVER gets run, it seems
{
 if (player.ActiveInventory == iTemC) {
   cEgo.Say("Hello, would you like this item?");
 }
}



Do I have to set the"Handle inventory clicks in script" to true to get this to work? Why and when does the game lose the player.Active.Inventory?
If I'm still not giving enough info to you guys, can you  be more specific on what info or part of script do you need? If absolutely necessary, I can post a link to a copy of my entire global script file.
#2644
I have an inventory, and there are three items in this inventory (A, B and C)

When i select the items in the inventory by clicking them, my cursor becomes the inventory item, which I believe means, that my active inventory item is now the item shown.

If I use item A on item B in the inventory, it works and they combine into a new item by removing the two items and replacing them with a new one, so this far all seems okay, yes?

Now: I select a new item (C) from the inventory, everything looks ok and then I use the item on a character as follows:

Code: ags

function cSidecharacter_UseInv()
{
 if (player.ActiveInventory == iTemC) {
   cEgo.Say("Hello, would you like this item?");
 }
}


The result: the game thinks I just clicked on that character normally, causing my character to talk with the character!
What in the world am I doing wrong?
#2645


New version


I need ideas on how to improve this sprite. Not so much in the shading, or adding colours to make it detailed, but to make it look more natural while keeping it easily animateable.

All ideas are welcome!


EDIT: Updated sprites added 28.11.2009
Pics are in 2x original size:


EDIT: Walkcycles completed so far

(Thanks to Brentimous for prettying-up this walkcycle for me)
#2646
Okay, this is getting weird.

I just created a second room within the same game, using the same walkable area mask and POOF: The character cannot get stuck anymore. I turned off the script that moves Ego to a walkable area, and still he wont get stuck!
I then created the script that follows what walkable area Ego is on, making him say "Im on zero" when he walks onto the walkable area "0". In "Room 1", he walks to the edge, speaks the line and is stuck in a loop saying the line, due to it being in a repeatedly execute section of the global script.

BUT in "Room 2", which to my understanding is identical to room 1, he speaks the line once and is then returned onto a normal walkable area automatically! I've checked and double-checked. I didn't do this! AGS just seems to function differently in different rooms when it comes to this issue.

NOW: I created a template of "room 2" and used it to replace "room 1" and everything's workin perfectly!
I don't get it! Same mask, same resolution, same values of scaling on each walkable area: EVERYTHING!
On the other hand, a template of "room 1" used as any other room, results in getting stuck just as before.

I am officially dumbfounded!
#2647
Quote from: Vince Twelve on Mon 15/06/2009 15:26:23
I'm not sure how you would be having this bug with the pathfinder while no one else has this problem.  I have rooms with walkable areas similar to yours and have never seen a similar problem.

However, I had one person email me about having a bug in Linus Bruckman where she would keep getting stuck when the player would walk off a corner.  No matter how hard I tried, I could never reproduce it, but she could send me a save game that had the player stuck off of the walkable areas.  She said it happened to her every time she played, but no one else ever had this problem.  I was never able to help her.

Could there somehow be an issue with the way one computer calculates the path while other computers would calculate it fine?

WHAM, can you upload an example room that has this problem (without your jump back to walkable area fix)? To see if other computers have the same problem while playing?

So far three computers in the hands of three poeple have reproduced the effect. I'll PM you the link to the test room I'm working with, so you can see what's going on for yourself, if you're really interested. I'll get to it some time this evening.

Could the problem be in the fact that the game is in 640x400, with far wider scrolling rooms and there being a scaling effect in the walkable areas? Maybe the scaling causes the characters center point to move that one pixel over the side somehow?
#2648
Quote from: GuyAwesome on Mon 15/06/2009 11:24:28
WHAM, that solution is pretty similar to what I was thinking last night, actually. Just couldn't quite figure out HOW to do it at the time. One thing I would've added is an up/down move as well, but if you say it works as-is, I guess it isn't needed...

If the character only ever crosses the border by a pixel or two, and if this only happens near a non-straight 90 degree edge, sideways movement should be adequate.

If anyone has a better solution, I would welcome it! As it is now, it looks like my character gets some kind of seizures every now and then, as the game forces him to move back to a walkable area through trial and error. It also stops the character dead in his tracks, meaning that if the player was being chased: you're dead!
#2649
EDITED: My solution (I must have been too tired to realize even this last night).
RE-EDITED: Simplified the code, removed unnecessary bits.
Code: ags

int walkies = 1;

function repeatedly_execute() {

int areanumber = GetWalkableAreaAt(player.x - GetViewportX(), player.y - GetViewportY());

// When ego walks off a walkable area
if (areanumber == 0) {
// First force him to move one pixel left
  if (walkies == 1) {
  cEgo.Move(cEgo.x - 2, cEgo.y, eBlock, eAnywhere);
  walkies = 0; } 
  // And if that didn't work, two pixels to the right.
  else {
  cEgo.Move(cEgo.x + 4, cEgo.y, eBlock, eAnywhere);  
  walkies = 1;
  }
} 
// When all is right again, reset the rig.
else if (areanumber != 0) {
  walkies = 1;
}
} 


I dont think it's a pretty way to do it, but heck: it works!
#2650
Quote from: GuyAwesome on Sun 14/06/2009 23:31:08
Can you code in some temporary Display lines, to check whether the player is moving off Walkable areas? (Try sticking them in one of the player interactions, and trigger them when the player gets stuck.) If it IS that, then that code should fix it but this way might rule it out for sure. I'm afraid that's it for ideas from me... It could be a related issue, of the pathfinder taking so long to find a valid route that it basically gives up and doesn't move you - but I'm not sure WHAT could cause that to happen.

You said it seems random, but is there some action or sequence that's more likely to cause it? Sorry, kind of clutching at straws now :-\

I'll keep trying to verify the reason this happens. Its not so much random anymore, now that I know what to look for. When I walk near the diagonal edge of a walkable area, I get stuck. Sometimes it happens instantly, sometimes it takes a few clicks to get stuck.

EDIT: Okay, I've now confirmed that my EGO gets out of the walkable areas and ends up on area "0".
The below code makes him say "0 areacode" when he's stuck. Int Areanumber is the number of the area Ego is standing on.

Code: ags
if (timer >= 1) {
  timer = timer - 1;
} else {
  timer = 400;
  cEgo.Say("%i areacode", areanumber);
  cEgo.Say("TIME");
}


I then tried adding:
Code: ags
if (areanumber == 0) {
  player.PlaceOnWalkableArea();
}

into the repeatedly execute function, but nothing happens!

Ideas?

EDIT: It now seems that everything else is clear, except that the "player.PlaceOnWalkableArea();" doesn't do squat. Any alternative ways to force my character to return to a walkable area? Ways to reinforce the code here? Anything?

#2651
Quote from: GuyAwesome on Sun 14/06/2009 23:05:33
Could you use something like
Code: ags

// in global or room RepExec
  if (GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY()) == 0) player.PlaceOnWalkableArea();

It should only be a move of a pixel or so, so it should be massively noticeable when it happens.
Assuming there're no times you WANT the player not to be on a walkable area, but you could turn it on/off with a variable check.

Why it happens in the first place, I couldn't say - maybe changing loops nudges the character just slightly off the walkable area? (Could be related to what Khris mentions here.) I'm just guessing there, but it makes a kind of sense given that yes, that lo-res mask thing is the normal behaviour, IIRC, and it happens mostly on corners/diagonals where the downscaling might be most apparent. Anyway, whyever it happens, it shouldn't stop that code from working. (I hope.)

Seems useful, but I tried your code and it didn't help. Which leaves me to wonder, if something else than the character escaping the confines of the walkable area is to blame here? More ideas are welcome, I'll be trying out options until I stop getting stuck... This would be a game-killer bug if I released something this bad... :(

EDIT: Actually, I think there might be something wrong with the code. I made my character say "oh shit" whenever he supposedly walks off a walkable area, and no matter where he stands, he keeps saying it. Even when standing on a walkable area.
#2652
Hi!

I'm back with a new project, and I seem to be having a small issue.

I have a room with a walkable area mask, as seen below.



In the spots I've boxed, it seems that sometimes (seemingly randomly) my character can walk OFF the walkable area (seemingly by just one pixel) and become stuck. Any ideas on how to solve this?

Also: It seems that I can only have walkable areas and hotspots in 320x200 resolution (the finer areas of the mask are transformed into "blockier" ones when I import them into the game). However, walk-behind masks dont get the same treatment!?
Is this normal, or am I doing something wrong here?

(Using AGS 3.1.2)

Thanks for the help!

EDIT: I've noticed that only lines that Aren't in a precise 90 degree angle but run diagonally (I think that's the word) cause the getting stuck, alongside with corners.
#2653
Quote from: cat on Mon 04/05/2009 14:58:23
Is this a scrolling background? If yes, the white lines on the ground may look weird if the character is standing at the right end of the screen.

Yes, it is inteded to be a scrolling background. How will it look strange? Is there some other, better, way to do this?
#2654
Back for more:

The pic is huge, so I'll just link.

http://www.whamgames.com/images/Forumsht/mess_hall_01.png

Your thoughts? Ideas? Anything?
#2655
Critics' Lounge / Re: Homepage logo
Fri 03/04/2009 07:29:20
The one with the cleaner black bacground is much better, and I think it already looks great!
#2656
Quote from: SpacePirateCaine on Mon 23/02/2009 06:51:35
NSFW Pixelated Boobies below!


They're all waiting for you!

Here we have a recreation of the clothing-optional beach as seen in the demo with the new character sprites/GUI/some inventory implemented (and animated!) The background art hasn't changed yet, but the final product will have all of the backgrounds redone by the incredibly talented Miez.

Holy friggin' hell!!! This is the most beautiful thing I've seen on this forum EVER! *saved and stashed*

Edited by mod: Don't quote who post with large images.
#2657
General Discussion / Re: Medical robot
Sat 28/03/2009 08:01:28
Renal's pics have some potential. A little from picture A and a little from picture B, add some spices and mix well.
#2658
General Discussion / Re: Medical robot
Fri 27/03/2009 17:11:08
Drat! I forgot the pic I sketched to work! I'll get it up on saturday instead...

In the sketch I mage, the robot had only shoulders and the head, with elongated telescopic "arms" with precision tools at the tips. It also had this mechanical "tentacle" in place of its spine, which it could move around and use to hold items (in the image I made, it was holding a metallic tray so that the human doctor participating in the operation could place his/her scalpels and such on a surface that is always available.

It sounds like most people are preferring the humanoid form, leaving only the question: "How human?"


EDIT:

A quickie version... And posting this just made me realize I should've put this up in the critics lounge rather than here...

#2659
General Discussion / Re: Medical robot
Fri 27/03/2009 15:13:41
Quote from: dkh on Fri 27/03/2009 14:32:30
The star wars medical robot:
Forgot its name/class but google it and wiser you will be. May the force be with you.

I wonder what the fuction of the tube coming from its face is?
#2660
General Discussion / Re: Medical robot
Fri 27/03/2009 13:06:24
I'm kinda hoping to create a talking bot with an A.I. that would have its own role in the story of the game. I'm also thinking maybe it could be suspended from the ceiling on some kind of rail so it could move in certain areas of certain rooms (ER, OR, recovery etc). I'll get a crude image out in a few hours (when I get home from work so I can upload the image).
SMF spam blocked by CleanTalk