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

#1
Seems awfully long-winded but it worked, thanks!
#2
As the title says, is it possible to take a global variable, change the value in the room script, and then use the changed variable back in the global script?

header
Code: ags

int iCharAct[23];         // header declaration


room script
Code: ags

iCharAct[17] = 1; // changing value in room script


Global Script
Code: ags

if (iCharAct[17] == 1)
  {
 player.Say("1");            // should say this if iCharAct[17] is 1, but he doesn't
  }


The player should say "1" if iCharAct[17] was changed properly, but somewhere it was dropped. Any way to fix this or am I not allowed to change variables in the room script?

Thanks.
#3
Thanks guys! yeah I made all the chairs and tables one object, which caused issues, and my baselines were off too, I thought things would resolve themselves if i just left the baselines equal. Thanks
#4
I'm having an issue with the main character being behind the objects and the other characters, even when he should be in front.



The red stick figure is an npc with a baseline of 5,

the green figure is the player with a baseline of 5,

the blue table and chair are an object with baseline 4.

From his placement, shouldn't the green figure be in front of everything else?

also mind the placeholder mspaint drawings.
#5
That fixed it! I didn't notice that the 5 second interval wasn't actually 5 seconds, thanks dayowIron!
#6
No. cAlyssa is an NPC, should have made that clear, sorry
#7
So with some help I made a timer a little bit ago and it worked great, so now  im experimenting with it. I set the timer to 10 seconds and had it countdown. This works fine. My issue now comes from two parts. First, I wanted to add in something to happen when the timer was halfway done (timerValue == 5). This does what it's meant to, but then instead of continuing the countdown it's skipping straight to when the timerValue is 0 and repeating that. Secondly, I tried taking out the halfway event. The timer counts down to 0 but it won't reset like how I want it to. I put the whole thing in the Repeatedly Execute function for a room. Basically I'm asking how to reset the timer, and how to make something happen in the middle of the timer.

Code: ags

if (timerActive)
 {
   if (timerValue == 0)                   // when time expires
    {
      // timer expired
      timerActive = false;                // pause timer now by calling timerActive = false
      Display("Check");                   // so i know when the timer expires
      FadeOut(30);
      StartCutscene(eSkipESCOnly); 
      CharacterReset();                  // reset the day
      timerValue = 10;
      timerActive = true;
      EndCutscene();
      FadeIn(30);
      
      
      if (iChar[17] == 1)
      {
        dGabiVaca.Start();
      }
    }
   else if (timerValue == 5)              // do something when timer hits a certain time, then keep counting
    {
      cAlyssa.ChangeRoom(1,  733, 216);   // change room at certian time    
      timerValue--;                       // continue counting down
        
    }
    else timerValue--;                    // countdown... might make it a count up
 }
 
#8
I understand how to create and start a timer, and I know how to stop a timer, but is there a way to pause the timer and resume it from the paused point later?
#9
Well that sucks, okay, thanks! I think I know what I have to do then
#10
Hopefully this will be the last time I ask for assistance in awhile, is it possible to change a room twice in one cutscene? Like the game starts the cutscene, the player moves to a room, talks to someone, then moves to another room, is it possible to do that? because when I try it I keep getting an error.
Code: ags

if (act1score == 3) {
    StartCutscene(eSkipESCOnly);
    player.Say("I should get ready to go.");
    player.ChangeRoom(2, 330, 328);
    dendact1.Start();
    player.ChangeRoom(14, 456, 538);
    EndCutscene;
  }

it says that I have an error at the dialog bit, since there was a NewRoom command earlier.
#11
Ohhhhh!!! that's sick! Thanks for all the different options! I'm currently working on a game while also learning how to make it and it's really fun to learn all this new stuff. and you guys are helping immensely. Thanks!
#12
thanks! the Morgan's way worked and fixed the problem but the DoOnceOnly method did too, thanks both of you!
#13
So what I wanted to do was set up a dialog when the player got a certain score, I thought the best way to do this was to make a function that repeatedly checks to see if the player reached the score. However, when the score is reached it only does the first part (the player.Say part) and then keeps repeating that one part. How do I make it do both parts? Was the repeatedly execute function the wrong way to go?

Code: ags

 function repeatedly_execute()
{
 if (act1score == 3){
 player.Say("I should get ready to go."); 
 dendact1.Start();
 }
}
#14
Yeah, i just caught the while statement issue, I was experimenting with different things i could do and i forgot to change that back. Oh cool! I didn't think about trying that! Thanks, that'll simplify things.

PS: this is my first time posting and i have to say , the community here is really cool.
#15
Nevermind! I fixed it! I had to include both of the if statements in the same parenthesis, thanks for the help.
#16
Oh wow, thank you so much. That fixed that problem, but now im getting an error at the "&&" The tutorial showed that as the command to use, but is there something else i should use?
#17
Code: ags

function ckitty_Talk()
{
if (object[3].Visible = false) &&
(object[4].Visible = false)
{dkitty.Start();}

else if (object[3].Visible = true) &&
(object[4].Visible = false)
{dkittywantswater.Start();}

while (object[3].Visible = false) &&
(object[4].Visible = true)
{dkittywantsfood.Start();}

else Display("He looks busy.");
}



I'm working on a personal project of mine (it's about a cat). Basically I want one dialogue option for when neither of two objects are visible, then i want on option for when one of the objects is visible, and one for when the other is visible, but i keep getting a parse error at the beginning. I've been working on it for awhile now and i still can't figure out why. I'm still very new to this so any help would be appreciated.
SMF spam blocked by CleanTalk