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

Topics - rongel

#21
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.
#22
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:







#23
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!


#24
Hi!

I'm trying to do simple drag & drop puzzle. I have a room (without characters), and some objects that you are supposed to drag to right places. Currently i'm using following script:

Code: ags

function oMyItem_Interact(){
  while(mouse.IsButtonDown(eMouseLeft)){
    oMyItem.X = mouse.x;
    oMyItem.Y = mouse.y;
    Wait(1);


That works for dragging the item around (even though my item "jumps" a bit annoyingly every time it's clicked). But how can I drop the item in the right place so that new command is activated? For example if my puzzle had a draggable key and I would drop it over a lock, what is the best way to make it work? I have read the forums, but haven't found an answer (many of the old links are not working anymore...)

Anyway, all help is welcome, thanks in advance!
SMF spam blocked by CleanTalk