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

#1
Hi, Everyone,

           I really hope I'm not being too much of a nuisance but I've just been doing some game testing and I've come across a new error for something that was working perfectly until recently.  I have several books scattered throughout the game which, on interaction, change the room to show the books' texts (with no visible character).  In each case the previous room is restored on mouse click. 

I've coded each of these almost exactly the same (the only difference being room coordinates I want the character to go to) and they're all working perfectly - except for this one!  Can anyone see any errors in my script for this room please?

Code: ags

Overlay *textOverlay;

function room_Load()
{
         gStatus.Visible = false;
         textOverlay = Overlay.CreateTextual (155, 187, 200, eFontNormal, 53248, "Click to continue...");
}

function on_mouse_click(MouseButton button) 
{
       cChristian.ChangeRoom (cChristian.PreviousRoom);
       gStatus.Visible = true;
}


Thanks for your time and sorry to bother you again!

- Zephyr.    (roll)
#2
Hi again Everyone,

         OK, so I'm building my first "shop" in my game, but it's a little complex in that 2 separate transactions can take place by interaction with only 1 hotspot.  This is further complicated by the fact that each transaction involves having:
a). the correct amount of cash
b). the correct inventory item.

I've messed around for hours trying to sort out the necessary nested functions and my brain is about to explode!
Here's what my last attempt was:-
Code: ags

function hFont_UseInv()
{      
      if (cChristian.ActiveInventory == (iEmptyBottle))
{
         cChristian.Walk (225, 168, eNoBlock, eWalkableAreas);
}
      if (Money >= 5)
{
         cChristian.LoseInventory (iEmptyBottle);
         cChristian.AddInventory (iHolyWater);
         Money -= 5;
         Display ("You have a bottle of Holy Water.");
}
    else
{
         Display ("Not enough money.");
}
      if (cChristian.ActiveInventory == (iStMichael))
{
         cChristian.Walk (225, 168, eNoBlock, eWalkableAreas);
}
      if ((Money >= 5)  // error msg reads "end of input reached in middle of expression"
{
          cChristian.LoseInventory (iStMichael);
          cChristian.AddInventory (iBlessedStMichael);
          Money -= 5;
          Display ("Your medallion has been blessed.");
}
     else 
{
          Display ("Not enough money.");
}
}


Can anyone please tell me where I've gone wrong and (in simple terms) WHY it's wrong?
Thanks again,
- Zephyr   :confused:
#3
Hi again everyone!

So I've reached a point in my game where my main character shoots and kills another character (simply called cVictim), but I want the main character to interact differently with cVictim, depending upon whether she's alive or dead.  So I put in GlobalScript.ash:

Code: ags
bool IsVictimDead = false;


and in GlobalScript.asc:

Code: agsfunction cVictim_Look()
{
      if (IsVictimDead == false)
(     
         cChristian.FaceDirection (eDirectionUp))
         cChristian.LockViewFrame (CHRISTIAN_NORMAL, 3, 1, eStopMoving);
         cChristian.SayAt (15, 191, 300, "It appears to be a female but it's making a horrible sound...");
         Wait (5);
         cChristian.SayAt (15, 191, 300, "There's something very wrong here!");
         Wait (5);
         cChristian.UnlockView (eKeepMoving);
         cChristian.LockView (1);
}
    else
(
         cChristian.Walk (150, 68, eBlock, eWalkableAreas);
         cChristian.FaceDirection (eDirectionUp);
         Wait (5);
         cChristian.ChangeRoom (64);
}
}


But when I try to run the game, I'm getting a parse error at the line " if (IsVictimDead == false)".
I just can't seem to work out where I'm going wrong.  Can anyone help, please?  Remember - simplified instructions only please!  :cheesy:

- Zephyr
#4
Hi again, Everyone,

                           I've come to a point in my game where I want to have a working money system - finding and spending varying amounts of cash. Now, I know this question has been asked before (Khris answered a similar question from Shavit back in October 2013), and I followed those instructions to the letter (although I have to confess I didn't really have the faintest idea of what each line meant!), but I was getting error messages such as "undefined token money", etc.  Once again I've managed to get myself as confused as hell and I don't know if it's something that I've done (or NOT done), or if the problem is that the instructions that I followed from 2013 are now obsolete.

At the moment I have my character finding a moneybag (oMoneybag) which on interaction disappears and becomes an inventory item (iMoney), which on the Look command displays the amount of £30.  Later he finds another £5 and so on. I'm also going to make several shops where, of course, the total amount will change again.

Any geniuses out there who could help me out please?  Please note - you'll need to dumb down your replies for me I'm afraid!

-  Zephyr

???  (wtf)  :-[
#5
Hi Everyone,
                I'm trying to script a scenario where a secret door will be revealed only when a total of 4 hotspots have been activated.  I've tried a number of different things with no success.  After trawling through the forum, I thought I'd found the answer as someone else had the same problem but using objects rather than hotspots.  I therefore copied the instructions carefully, having already scripted the trigger enabled/disabled on interact bits :-

Code: ags
function room_RepExec()
{
      if (hTrigger1 == false && hTrigger2 == false && hTrigger3 == false && hTrigger4 == false){
      if (Game.DoOnceOnly ("A secret door opens!")){
         oSecretDoor.Visible = false;
      }
   }
}


That's when I found out that this doesn't work with hotspots!

Can anyone please help me to solve this problem?

- Zephyr   (wtf)
#6
Hi Everyone,
             
  I'm trying to script a scenario where the player can look at an inventory item, which will teleport them to a new room (from wherever they happen to be in the game), where a message is displayed and then return to their previous room on mouse click.  I'm tying my poor brain in knots trying to follow the manual and forums!

So far, I have in my room script:
Code: ags
Overlay *clue1Overlay;

function room_AfterFadeIn()
{
         clue1Overlay = Overlay.CreateTextual (107, 114, 200, eFontNormal, 32784, "Blah, blah, blah.");
         Wait (200);
         DisplayAtY (115, "Click to continue.");
}
Overlay *clue1Overlay;

function room_AfterFadeIn()
{
         clue1Overlay = Overlay.CreateTextual (107, 114, 200, eFontNormal, 32784, "Blah, blah, blah.");
         Wait (200);
         DisplayAtY (115, "Click to continue.");
}

and then in Global Script:
Code: ags
function on_event (EventType iClue1_Look());
{
         SetGlobalInt (1, cChristian.x);
         SetGlobalInt (2, cChristian.y);
         cChristian.ChangeRoom (11);}
         {
    if (event == eEventLeaveRoom)
    {
        cChristian.ChangeRoom on_mouse_click (MouseButton button) {
          cChristian.PreviousRoom, GetGlobalInt(1), GetGlobalInt(2);
          return;
    }
}


I'm getting parse error warnings and nothing is working for me right now.  Any and all help appreciated - but PLEASE try to dumb down your replies because I'm a complete NOOB!
Hell, I'm not even sure I've posted this message correctly!  :-[  Thanks All.
#7
Hi All,
        I'm a fair way into making my 1st game (and couldn't have come this far without picking up so much help from reading the forums - so a massive thanks for that!) and everything's been going great with playing music and sounds so far... Until, that is, I add my latest room.  I haven't added any new sounds (yet) and haven't altered the previous settings (honest, guv) but when I try to test run my game I'm suddenly getting a message:
Warning: Cannot enable MIDI audio
Problem; Failed to init MIDI music driver
You may suppress this message by disabling MIDI sound in the game setup.

OK, so I went to Default Setup and disabled MIDI, but it's still displaying this message. I've checked all my sound file extensions as I've seen you advise others and the weird thing is that ALL of mine are either .WAV or .MP3 files ONLY.

The fact that it was working before suggests that I've done something dumb when scripting this new room but I honestly can't see anything wrong there.  Does anyone have any ideas please?
:shocked:  :confused:








SMF spam blocked by CleanTalk