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

#321
Thanks Khris for the clarification! I have a long travel ahead so can't test this now. This small problem with one frame in the wrong place is surprisingly difficult to fix, but I will test this soon. My back up plan is to use sideway-view when the character is facing right, left-turns works with my current frames (character turning seems to be hard-coded clock-wise). But I really hope this works and doesn't cause any other problems! 
#322
Wow, that's a lot of heavy coding!

I think I got it somewhat working using that, walking and turning seem nice now. I had couple of problems: I use BASS Lightweight template so does that cause problems? When I click to object with interactions, the player will walk there, and I don't want that. Is it a issue with mouse.Mode == eModeWalkto, all interactions except looking happen with left mouse button.

The other was with "else ProcessClick(...);". Maybe a dumb question but what are those three dots? AGS gave me an error with those, and I had to put some values there. But I have no idea what they should be.

Thanks!
#323
AGS will simply overwrite it as soon as the IdleView kicks in or the player starts walking again.

So is the reason for turning not showing when still, that the character is not actually moving when he is turning? New loops 8 and 9 are still on and overwrite those turning frames. Only when the actual walking starts at frame 2, the loop stops? And when the player is walking already, turning works normally?
#324
I think I got rid of the speech view problem, I edited the code to look like this:

Code: ags
   if (!player.Moving && was_moving) {
    if (player.Loop == 1) {
      player.Frame = player.Loop - 1;
      player.Loop = 8;
    }
    if (player.Loop == 2) {
      player.Frame = player.Loop - 1;
      player.Loop = 9;
    }
  }
  was_moving = player.Moving;


Then I just added one more  loop to walk-views, so that each one has only one frame. Then added two speech-views to 8 and 9. It looks like it's working. It's weird but the nice smooth turning doesn't always happen, sometimes it seems the turning doesn't use all frames and i can see again the one frame in wrong place), then it starts to work again nicely. It's not a big problem, but just wondering what causes it.


EDIT:

Ok, noticed the problem. The character only turns smoothly and uses all the frames when he is already moving. If the character is standing still and I make him turn, it doesn't work, and I can see the problem frame again. So everything goes nicely only when he is walking already. I tried to edit the script but didn't get good results...
#325
Thanks, this sounds promising! Everything else looks good but, the code seems to mess the speech view, if the player starts to speak while standing sideways, game crashes. I created another loop 8 to speech view, but it just flips the frames, and also seems to flip the character in opposite direction. So is there a way to make the code not affect the speech views (and probably idleview also)?
#326
Ok, for me the delay is just too long, it takes a second or longer before the idleview kicks in (if the command is not in repeatedly execute. I was just wondering how people overcome this, there must be many games that use sprites that are not standing exactly sideways when still, and use the turn character-option. But many thanks, your solution seemed to be quite close to working!
#327
I tried setting timer to 1, and -1 (and many other variations), but there was still the same annoying delay. Only when the command was in repeatedly execute, the transition was instant. If I remember right, the idle view frame delay was hard-coded, so could that be the issue? Have you used this method yourself before? Anyway, really appreciate the help, thanks!
#328
Where the "player.SetIdleView"-command should be placed? I tried placing it to repeatedly_execute_always, where it seemed to work nicely. The transition to this new idle view was instant, but the game will only play the first frame. At game_start() it will play the following frames also, but it took a second or so for the view to switch to idle (even when the timer was set to 0), so it didn't look that nice...
#329
Thanks for the quick reply!
I need to test that idea, never thought of it. I'm a bit afraid that it will mess up my normal idle views (I haven't played around with those yet that much). I mean that can I still use another idle view when the character has been still few seconds?
#330
Hi! I'm having a problem with my character's turning. My first side way walk frame shows the character 2/3 sideways, so that the front of the body is also showing a bit. Much like in Indiana Jones and Monkey Island games. So the walk-loop is completely from the side, but when the character stops, he turns a bit to the "camera". This is the way i want it to be, it shows more of the characters face and looks nice. Now I would like to add the diagonal first frames as well, to get a nice smooth turning animation. But because the first frame in the side-loop isn't completely from left or right, the turning doesn't work smoothly. The cycle goes something like this when I turn from left to right:
left-upleft-up-upright-my standing still frame where the character is looking diagonally a bit down-left. So that frame pops up and looks annoying. This is complicated to describe, but I hope you got the idea.

So can I have both: a nice turning animation and still have my character to stop in 2/3 side way position after the loop, like in the LucasArts games. Can it be done without extensive, high-level coding? My current option is just to abandon the turning-option, which is a shame because it looks very good and works well otherwise. I have read through old posts but haven't found any resolution to this.
#331
Nice demo! We need more Lovecraft games that actually are based on his writings. Also it seems you know the settings and the mythos well, it was nice that the demo was very similiar to the actual story.

Good luck with the rest of the game!
#332
Wow, that was fast, thanks for the help!

I'm going to try out these now and figure them out. New question are coming probably soon! 
#333
Hi!

I'm starting to build a game which is based on days. There will be about 50 days, each one will have it's own events, for example you can buy a newspaper and read days news. I have currently a working system (at least it seems to work) where day ends and another starts when you go to bed. The player has a calendar at home, and by looking at it, it should tell current date but I can't figure out how to do it/which is the best way to do it. Also I'm not sure if my day-cycle system is any good, I would like to have a solid ground where to build on. And I have tried to keep it simple, because my scripting skills are quite limited!

Anyway, here is my current day-changing code:

I have a global variable called Day_counter set to 1, and a room script when you go to bed:

Code: ags

function hBed_Interact()
{
Display("You go to sleep.");
Day_counter += 1;
}


Then in Global script I have this under repeatedly execute:
Code: ags

          if (Day_counter == 1) day1();
          if (Day_counter == 3) day2();
          if (Day_counter == 5) day3();
          if (Day_counter == 7) day4();
          if (Day_counter == 9) day5();
          if (Day_counter == 11) day7();
          if (Day_counter == 13) day8();
          if (Day_counter == 15) day9();
          if (Day_counter == 17) day10();
          if (Day_counter == 19) day11();
          if (Day_counter == 21) day12();
          if (Day_counter == 23) day13();
          if (Day_counter == 27) day14();


So that activates my days:

Code: ags

function day1()
{
  Display("March 1st");
  Day_counter +=1;  
}

function day2()
{
  Display("March 2nd");
  Day_counter +=1;
}

function day3()
{
  Display("March 3rd");
  Day_counter +=1;  
}

function day4()
{
  Display("March 4th");
  Day_counter +=1;  
}

function day5()
{
  Display("March 5th");
  Day_counter +=1;
}

function day6()
{
  Display("March 6th");
  Day_counter +=1;  
}


Every day adds one to Day_counter so that it stops the repeatedly execute command. This seems to work, allthough I bet there is a nicer way to do this. My real problem is how can I make day sensitive text to my calendar and newspaper. I guess I could use the same Day_counter in it, but it doesn't seem very elegant way. Something like this:

Code: ags

function hCalendar_Look()
{
  if (Day_counter == 2) Display("It's March 1st.");
  if (Day_counter == 4) Display ("It's March 2nd.");
  if (Day_counter == 6) Display ("It's March 3rd.");
}


I tried to use Strings and more advanced stuff, but got nowhere. So which is the best way to get the calendar/newspaper to use the right text for current day? And is my current system any good? Any help is appreciated, thanks! :smiley:







#334
Thanks Khris, tested it just now and it seems to work!

It's a small thing, but it somehow makes the game seem more professional :grin:
#335
Sorry to bring back an old thread but my question is 100% related to this!

I'm using this script (the bigger at the end of the post) to build my own save/load GUI. Everything works, it's a great help. But I would like to add a warning when the player is saving on top of old save and overwriting it. Something like: Are you sure you want to overwite the existing game? Is there a easy way to add this warning to it? I tried to find pre-made templates also but the links didn't work...
#336
Thanks for the replies!

Well still didn't get it working. I'm using the "Lightweight BASS Template", so if I'm right, I need to add this
Code: ags
InventoryItem *ActiveItem;
to TwoClickHandler script? The basic GlobalScript tells that all mouse clicks are handled there. I tried it but it still gave me the same error.

Other thing is that where do I need to write the actual code for the second inventory? In the puzzle room's script, Global script, or to the TwoClickHandler?

EDIT: I put both codes to the TwoClickHandler script, and I don't get the error anymore, I still can't move my second inventory object (or get the mouse cursor to change).
#337
Hi!

So my situation is this: I have a puzzle room that uses two inventories. First is the normal one, and the second is room specific (it shows only in this puzzle room). Both appear in the same view at the same time. I read upon the subject and managed to create a dummy character (cDummy) and I made a new inventory for him. I can make items appear in the new inventory by giving them to my dummy character, but I can't select or use them! So what is the best way to proceed? I read that it shouldn't be necessary to switch player character, that you could switch inventory with a script.

I found this piece of script that should help, but I cant seem to get it working:

Code: ags
// eMouseLeftInv
 
  if (GUIControl.GetAtScreenXY(mouse.x, mouse.y) == invSecondaryInv) {
    ActiveItem = inventory[game.inv_activated];
    mouse.Mode = eModeUsermode1;
    mouse.ChangeModeGraphic(eModeUsermode1, ActiveItem.Graphic);
  }


Is "invSecondaryInv" the name of my secondary Inventory Window? And what "ActiveItem" means? I seem to get an error code always there... This might be a bit too advanced for a beginner like me, but I must know if it's possible or not before I continue. Thanks!


#338
Got it working, thanks! :-D

Maybe it needs a bit fine tuning, but overall it's great, I hope this helps others as well!
#339
Ok, finally fot it working!

Well mostly, for some reason nothing happens when I drag my "key" to my "lock", the key just jumps back to it's starting location. Hmm?

EDIT:

Does (oMyItem.X == oLock.X && oMyItem.Y == oLock.Y) mean that they have to be exactly on the same position? My lock object is large, but does that mean I need to find the exact pixel?
#340
Thanks for the super-quick answer!

That is quite heavy stuff... I did try your example, but my object didn't move anywhere, but at least no script errors!

Is the onMyItem a new item, what is it's difference with oMyItem? And is UnlockTheLock(); just a place for any command, for example: Display("Succes!");

Anyway, thanks for the info, I'll keep trying!


SMF spam blocked by CleanTalk