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

#1
Advanced Technical Forum / Re: Timer help
Thu 06/10/2011 19:39:04
Quote from: pcj on Thu 06/10/2011 19:04:42
Don't post the same question in more than one forum at the same time - it won't be answered any faster.

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=44580.0

Yeah.. wasn't trying to get it faster.  Just wasn't sure which forum to post it in.  See the response in Beginner forum.
#2
Thanks for the response.  What you gave me definitely stopped the heatUp() function, but wouldn't continue it.  I finally figured out what it was.

function repeatedly_execute()
{
   if (IsTimerExpired(1))
    {
      if (!waterTimerEnabled || (waterTimerEnabled && IsTimerExpired(2))) {
        heatUp();
        SetTimer(1, 80);
        waterTimerEnabled = false;
      }
      SetTimer(1, 80);          <-- Needed this to continue original timer.
    }
}
#3
Ok all.  here's the situation.  I am creating a game in which a guy is burning from the inside.  I have it set to timer 1 with setTimer(1,40)

in GlobalScript.asc
---------------------------------------------------
function repeatedly_execute()
{
   if (IsTimerExpired(1)==1)
    {
      heatUp();
      SetTimer(1, 100);
    }
}

That function works fine.   I have a water bottle that currently lowers the character's heat value by a defined value.  That also works.  I am now trying to pause the heatUp() function for 60 seconds after using the water bottle, then continue.   I have tried to create my own timer to decrament in a while loop for the pause, but it doesn't seem to work.


function iWaterBtl_Interact()
{
   coolOff();                                                              // cools off player and designated amount
   waterToken -= 1;                                                 // decrements waterToken by 1, starting at 4 (declared in global variables)
   if (waterToken ==0)                                             // if waterToken reaches 0, remove iWaterBtl from inventory
   {
      cChristian.LoseInventory(iWaterBtl);
   }
   mouse.Mode=eModeInteract;
     while (waterTimer >= 0)                                    // water timer declared in global variables as int 60
     {                                                                        // while waterTimer is greater than 0
     heatIndex = heatIndex;                                    // set heatIndex to itself (aka.. pause heatIndex)
     waterTimer -= 1;                                                // decrement waterTimer by 1
     }
}
#4
Advanced Technical Forum / Timer help
Thu 06/10/2011 18:44:29
Ok all.  here's the situation.  I am creating a game in which a guy is burning from the inside.  I have it set to timer 1 with setTimer(1,40)

in GlobalScript.asc
---------------------------------------------------
function repeatedly_execute()
{
   if (IsTimerExpired(1)==1)
    {
      heatUp();
      SetTimer(1, 100);
    }
}

That function works fine.   I have a water bottle that currently lowers the character's heat value by a defined value.  That also works.  I am now trying to pause the heatUp() function for 60 seconds after using the water bottle, then continue.   I have tried to create my own timer to decrament in a while loop for the pause, but it doesn't seem to work.


function iWaterBtl_Interact()
{
   coolOff();                                                              // cools off player and designated amount
   waterToken -= 1;                                                 // decrements waterToken by 1, starting at 4 (declared in global variables)
   if (waterToken ==0)                                             // if waterToken reaches 0, remove iWaterBtl from inventory
   {
      cChristian.LoseInventory(iWaterBtl);
   }
   mouse.Mode=eModeInteract;
     while (waterTimer >= 0)                                    // water timer declared in global variables as int 60
     {                                                                        // while waterTimer is greater than 0
     heatIndex = heatIndex;                                    // set heatIndex to itself (aka.. pause heatIndex)
     waterTimer -= 1;                                                // decrement waterTimer by 1
     }
}
#5
Hey all.  I'm trying to get a conditional dialogue option to be a different color than the standard choices.  Is this possible?  I don't want to change the color of what he actually says in-game, just the text line in the options.  Please help!
#6
We'd want it to stay indefinitely unless the heat goes back down.  We've recently decided to try to do it through a gui we're making for a particle overlay.  So as you heat up, the room will appear to start smoking.  But if someone can figure it out to show that isn't on a timer, that would be great.
#7
My team is trying to create a graphical overlay that will start off at a percentage of transparency and then get more solid (less transparent) as your heat level increases.  I used the code in the Dynamic help as a starting point.   The problem I'm having is I'm unsure where to place the code.  I either get the overlay to show up and infinitely run, or it shows up one time and so fast that you don't ever see it.  I want this to happen on any level throughout the game.  I've tried to place it in the   function repeatedly_execute()   and the   function repeatedly_execute_always() .   Please help.  Also, if you know how to set the transparency of the overlays, that would be excellent info.


function OL()
{
if (heatIndex >= 3)
  {
    Overlay* Boom = Overlay.CreateGraphical(100, 100, 71, true);
    Wait(40);
    Boom.Remove();
  }
}
#8
Yeah.  We got it working, once we changed it off Direct9
#9
How do I play a .wmv file in my AGS game?   I have made an intro video to my game and can't figure out where to place it or add it, so that I can call the PlayVideo(); function.   Someone please help!!  Trying to figure it our for our class.
#10
I used your error checking.  It worked.  But it turns out that the issue was that the character was starting out in the room within the bounds of the object, so it would walk through it.  I had to move away from the object, then back towards it for it to actually collide.
#11
I currently have this in the room script:

function room_AfterFadeIn()
{
 oCouch.Solid = true;
 oCouch.BlockingHeight = 160;
 oCouch.BlockingWidth = 400;
}

The character can still walk through the couch.
#12
It just doesn't work at all.  I am trying to do the item.solid = true; function. 

I have tried everything he suggested and I can't get it set so my character can't walk through the couch.  The couch name is oCouch, and has Item ID = 0.  All of our objects are set as oItemName to help clarify the variable as an object.  If I can get one object to work, I should be able to figure out how to do all the rest of them.  Just wasn't clear as to how he said what code to put where.  Some were room script references, while others were .ash references (header file). 
#13
Can someone clear this up a bit?  Still having issues getting my objects to be solid.  I've tried all methods on here, but it still isn't working and the way he worded it is kinda confusing. 
#14
I got this error using that code:


Failed to save room room1.crm; details below
room1.asc(2): Error (line 2): struct cannot be passed as parameter


tried changing Object (which is a struct) to object

then got this error:


Failed to save room room1.crm; details below
room1.asc(2): Error (line 2): PE03: Parse error at 'object'
#15
I'm trying to  (A) make objects in my game solid.  and (B) Create a function that can set multiple objects to solid.

For Example:

Table.Solid = true;   (This is what wiki said but didn't work)

Function makeSolid(object)
{
    object.solid = true;
}

so I can just call:

   makeSolid(Table);  (This will call the table.solid = true; function)

Please help ASAP. 
SMF spam blocked by CleanTalk