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

#181
 heh, the solution was to add 100 to rightx ;)
  thanks for the while loop idea :)
Just one more question: is there a way to test whether a mouse is beneath a line runningly up at 45 degrees?
    thanks.
#182
 Thanks!
  I have another question, related. I want the GUI to appear if the player clicks and holds the right mouse button. if the mouse is above a certain x position (while right mouse is held down), i want it to display an the GUI with a different background image (image 7), and if below, a third image (image 8). I tried this code:
Code: ags

  if(mouse.IsButtonDown(eMouseRight)&& undone == true){
   undone = false; //so GUI won't move when mouse moves
      rightx = mouse.x - 100; //centre image on mouse
      righty = mouse.y - 100; //centre image on mouse
      gRightClick.SetPosition(rightx, righty); //uses the centreing
     gRightClick.Transparency = 0;//displays GUI from invisible
 }
 if(mouse.IsButtonDown(eMouseRight) != true){
  gRightClick.Transparency = 100; //get GUI back invisible
   undone = true; //so one can right click with effect to get the GUI
 }
   if(gRightClick.Transparency == 0){
     if(mouse.x > rightx){
       gRightClick.BackgroundGraphic = 7;
     }
     if(mouse.x < rightx){
       gRightClick.BackgroundGraphic = 8;
     }
 } 

    However, the only image ever displayed is image 7, and never image 8.
     what do I need to do?
      Thanks.
#183
 Hello all!
  I was wondering whether it is possible to implement an object into many rooms (instead of implementing the object in each room, and updating it to the last rooms status). For example, maybe a healthbar which has 5 different HP stages, and if the player gets damaged, another object is displayed for a different HP stage, I wouldn't want to add 5 objects to many, many rooms i will be using. (This is an example).
   Thanks
#184
 Thanks for the tips!
   In fact, I had to call a function again (outside diolog), and would have been stuck without the advice ;)
#185
 Thanks!
  Yep, it worked fine! I never thought that script was particularely useful, but now I know better...
#186
 hey all!
   I have come across a problem to do with calling a function inside dialog i have a function inside the global scripts GoBack(int gg). I tabbed in dialog, then coded:
 
Code: ags

    GoBack(beforetalk1);
  

  when that wouldn't work, I searched the index, and tried
 
Code: ags

  import function GoBack(beforetalk1);
  

   all this at the end of a dialog.
   first time it complained "Undefined token 'GoBack' " fair enough
   Second time however, it said "import not allowed inside function body"
    Is there a way around this?
    thanks
#187
Thanks!
#188
 Hey all!
  I've been trying to execute this code:
   
Code: ags

    cChar1.SayBackground("try %d", tries);
   

   yet the engine will not allow it, something along the lines of:
     wrong number of parameters in call to 'Character::SayBackground'
   Is there a way of displaying an integer in a say background text?
       Thanks
#189
okay, peeps, problem solved, I merely had to change the UlockView to the end, but thx 4 the wait bit, that really helped ;)
#190
 okay, something strange has just happened:
  I have 4 cZom characters, when one of them has their zomhp (1,2,3 or 4) depleted to 0, that character does exactly what it's supposed to, but when another has it's zomhp depleted, it flashes to where it should be, then returns and keeps following. Not only that, but the one that's meant to be in the corner suddenly starts to chase again:
here's the code:
 
Code: ags

 if(zomhp <= 0){
    cZom.UnlockView();
    region[1].Enabled = false;
    cZom.StopMoving();
    Wait(40);
    zomhp = 10;
   cZom.x = 250;
   cZom.y = 15;
  }
  if(zomhp2 <= 0){
    cZom2.UnlockView();
    region[1].Enabled = false;
    cZom2.StopMoving();
    Wait(40);
    zomhp2 = 10;
   cZom2.x = 10;
   cZom2.y = 205;
  }
  if(zomhp3 <= 0){
    cZom3.UnlockView();
    region[1].Enabled = false;
    cZom3.StopMoving();
    Wait(40);
    zomhp3 = 5;
   cZom3.x = 310;
   cZom3.y = 430;
  }
  if(zomhp4 <= 0){
     cZom4.UnlockView();
    region[1].Enabled = false;
    cZom4.StopMoving();
    Wait(40);
    zomhp4 = 10;
   cZom4.x = 580;
   cZom4.y = 220;
   region[1].Enabled = true;
  }

  I find this unexplainable
  Thanks
#191
thanks, but the character Zom4 just flashes once on his designated place before flashing back to the place zomhp4 was reduced to 0.
  maybe the region code could help:
   
Code: ags
 
function region1_Standing()
{
  if(cZom4.View != 6){
 cZom4.FollowCharacter(cEgo, 0, 0);
  }
  if(cZom4.View == 6){
    cZom4.FollowCharacter(null);
  }
} 

cZom view will equal 6 when zomhp4 is equal to 0. the region covers the entire room, if that helps.
  thanks
#192
 Hey All!!
  I have a question concerning character relocation. I have a region (1) where a character will follow you in, but if the varial zomhp4 is equal to 0, then he should move back to another position.
Code: ags

 if(zomhp4 <= 0){
    cZom4.UnlockView();
    region[1].Enabled = false;
    cZom4.StopMoving();
    zomhp4 = 10;
   cZom4.x = 575;
   cZom4.y = 200;
  }

  the only problem is that the character remains in the same position as he stopped in (which he does if the zomhp4 = 0), he doesn't go to the coordinates given
  am i doing something wrong? (answer: yes), and how can I correct it?
   Thanks
#193
Yep, it worked.
  Thankyou again
#194
 Hey All!
  I've searched the manual and index, but I can't find something on this:
      How does one get 2 characters to move at the same time according to each others movements? I'm trying to achieve a sort of minigame where the NPC is walking in the opposite direction. The eNoBlock doesn't work because my character is constantely moving. Is there a solution?
     Thanks
#195
cool, thanks!
#196
 It's quite easy to make AGS tile based, as I found out; using 2 regions and putting them into a chess like pattern, then telling my character to stop whenever he enters a new region, to let something else happen. Although, I'm having trouble with the keyboard bit at the mo...(see other topic)
#197
Beginners' Technical Questions / eKey question
Thu 28/05/2009 14:26:00
 Hey all
   I am trying to make something happen when the user presses a key, and only for that room. I got the code and the claim event, but apparentely I need to include a function or something (the index wasn't clear): on_key_press. how do I create a code that only works for that room? I tried:
Code: ags
 if(keycode == eKeyRightArrow){
    cEgo.Walk(cEgo.x - 40, cEgo, eBlock, eWalkableAreas);
    ClaimEvent();
  }
 
, but it didn't recognize 'keycode'
        thanks
#198
Thanks guys!
  it works now, my myyysticcc prrroooojjjeeccct!!! thx for all the help :)
#199
 Hey All!
   I'm trying to trigger an event when one character gets close to the other (say about, 5x and 5y away). I tried the "IsCollidingWithChar" method:
                 
Code: ags

                if(cChar1.IsCollidingWithChar(cEgo) == 1)//tried to also put in numbers like 50 etc
                

                 but one character just walks round the other. I also tried the "AreThingsOverlapping", but that seems to only work with objects.
                Is there a way to solve this?
                   Thanks ;)
#200
Hey all!
  I'm trying to give the player time for 3 seconds to move the mouse before the narrator starts to talk again, as part of a tutorial. But my code is simply not using the if statement for the timer, here's the code:
 
Code: ags

    function room_AfterFadeIn()
{
 Mouse.Visible = false;
 gIconbar.Visible = false;
 gStatusline.Visible = false;
 cEgo.Say("&19 hello world!");
 Wait(40);
 cNarr.Say("&1");
             //continues with Narr talking
 Mouse.Visible = true;
  gIconbar.Visible = true;
  gStatusline.Visible = true;
 SetTimer(2, 120);  //heres the timer
 if(IsTimerExpired(1)){  //here is where it is meant to go onto the
                                     //next bit
   Mouse.Visible = false;
    gIconbar.Visible = false;
    gStatusline.Visible = false;
   cNarr.Say("&7");
   Wait(40);
   Mouse.Visible = true;
   gIconbar.Visible = true;
   gStatusline.Visible = true;
   SetTimer(3, 280);
   if(IsTimerExpired(3)){
     Mouse.Visible = false;
      gIconbar.Visible = false;
      gStatusline.Visible = false;
     cNarr.Say("&8");
     Wait(40);
                   //more Narr talking
     Mouse.Visible = true;
     gStatusline.Visible = true;
     gIconbar.Visible = true;
   }
 }
}

  thankyou
SMF spam blocked by CleanTalk