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

#21
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
#22
 :-D
Hi Again,

           Thanks, Matti! I'll try that again.

- Zephyr.

:-*
#23
Hi All,

            Sorry to bug you again, but I just can't figure this out!

Matti, I decided to try your solution first as I thought it would be a simpler/easier way. I followed your example exactly but on trying to test run the game, it's telling me that there's no such token as "combine clues",even though I put that in Global Script AND in the room script each time a clue was found!

So next I went with Cassiebsg's suggestion, but it keeps telling me there's a ( missing in the "if" line.  I copy/pasted it just as you had it, so I have no idea what I've gone and done now!

can anyone help me please (again!);  :( ???

- Zephyr
#24
Hi Matti and Cassiebsg,

            Thank you so much,both of you!  Why oh why does "computer speak" have to be so complicated?  It's time someone taught them plain English!!! lol
Anyway, I'll try your suggestions out right now. Thanks again.

- Zephyr.
:-*
#25
Hi again, Khris (or anyone else out there),

                 I'm now working on a part of my game where I've had the player collect 5 separate clues (each one a separate inventory item) and I'd like to put in some code which, upon finding the final clue, all 5 items will be replaced by just one.  You see, each clue is part of a short poem and is just a little wordy so the plan is, if I can replace them with just one, I can create a new room which will display the entire poem each time this new item is viewed, if that makes sense.

I don't speak "computer" too well and have trouble finding the correct wording, etc., but I thought that maybe I could put something in Global Script saying something like:

Code: ags
if cChristian.ActiveInventory == (iClue1 && iClue2 && iClue3 && iClue4 && iClue5)
cChristian.LoseInventory (iClue1 && iClue2 && iClue3 && iClue4 && iClue5);
cChristian.AddInventory(iWholeClue);


Is this the correct wording or am I barking up the wrong tree again? Is there maybe a simpler option?
Thanks again in advance for any advice. I really am trying to learn.

- Zephyr
#26
Hi Slasher,

               Man,you're my hero!  I did everything you said and it's working perfectly!  When I read complex replies, my poor brain just turns to mush, but your instructions were so simply put that I had little trouble following you.

Thank you so much for your help!

- Zephyr
:-D  :-*
#27
Hi Jack,

          Thank you for replying so soon. What you're advising sounds fairly simple... but when I say "dumb down", I mean REALLY dumb down! (I'm so sorry, I get so confused with Global Scripting for some reason!)

Can you give me a clue as to just how to word it please? And would this automatically keep a tally of changes to money throughout the game?

-  Zephyr
:undecided: :confused: :embarrassed:
#28
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)  :-[
#29
Hi Khris,
           Thank you so much for your help!  I just implemented your advice and it works just fine.

I'm learning so much from you when I consult the forum (though some of it is a bit beyond me - but I'm getting there slowly!) so thanks again.

- Zephyr   :-D (nod)
#30
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)
#31
 ;-D

Thank you all for your (simply put) input.  I was reading all kinds of information from the tutorials, manual and also from (what I thought sounded like) problems similar to mine and I think I just got confused with it all and ended up overcomplicating the whole thing!  I will definitely rewrite and simplify.

Matti, you're quite right - I only created the Room 11 thing because I couldn't seem to code the Clue details to appear when looking at it within the inventory!  I would much prefer to do it that way, if I can cobble something together. 

Thank you all so much for your help.

- Zephyr
:-D
#32
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.
#33
Thanks for taking time to get back to me, Crimson.  I've actually fixed the problem in a different way.  It turns out that I had my browser running in the background and it was causing a conflict with my game settings. When I test ran the game alone, it was working perfectly.

Sorry to have bothered you - this is my first attempt and it can get a bit overwhelming sometimes.
Thanks again for your advice.

;-D
#34
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