Help for WHAM - All solved

Started by WHAM, Sun 18/03/2007 09:44:41

Previous topic - Next topic

Ashen

I'm 90% certain this question has been asked before, but I can't find the damn thread...
As I remember it, the answers boiled down to what Recluse said anyway, but if you can find it, there might be some other options for you.
I know what you're thinking ... Don't think that.

Recluse

Quote from: WHAM on Sun 05/08/2007 08:58:47
Yeah... I was thinking about abandoning walk to points and using cEgo.Walk...

Personally, I never trust the Interaction editor, or any of AGS's "graphical no-scripting needed functions". I'll always rely on my code to get things done, that way I have complete control.
All your verbcoin are belong to us.

WHAM

Hi! Bringing this thread back from the dead, as I'm back on the project and in need of help once again!

I worked a good while, making all kinds of changes to my game and as I tried to test-run it, I got the following error:

_AutoGenerated.ash(59): Error (line 59): macro 'ELLIE' already defined

in the Output window.

I have NO idea what could've caused this and I've been triyng to delete my most recent additions to the room scripts I was making, but with no effect. Any good ideas are welcome!

EDIT: oh! And ellie is one of the characters in the game, referred to with cEllie. Although that name is not supposed to be used in any of the games script at the moment, making this even more a mystery to me.
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Khris

Afaik, AGS generates that script immediately before compiling the game, and naming your character cEllie will add the line "#define ELLIE 24" to that script.
Try renaming the char and/or look for anything else with that script name, maybe a view?

WHAM

Found it... The Views and characters had the same name... Didn't pop into my little mind that they cannot have the same name! >.<

The game is nearing completion at last, only a month or so until deadline! I might be popping here for more help in that time...
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

WHAM

Here's a codemonster that is giving me a headache. The problem is that of the following piece of code, only certain bits and pieces are run, while the rest is not, and I cannot find a reason why! Further explanation in comments of the code:

Code: ags

function room_AfterFadeIn()
{
if (GetGlobalInt(1) == 10) {
  // Player ends his move on region 1 so we disable that for the time being
  DisableRegion(1);
  cDude.FollowCharacter(null);
  // Move the player to the region
  cEgo.Walk(273, 143, eBlock, eWalkableAreas);
  // The walkable area is not removed!
  RemoveWalkableArea(2);
  //From here on out, the script plays out correctly, until...
  SetObjectView(0, 5);
  AnimateObject(0, 0, 5, false);
  Wait(20);
  cEgo.Walk(296, 139, eBlock, eWalkableAreas);
  cEgo.ChangeView(15);
  Wait(20);
  AnimateObject(0, 1, 5, false); 
  Wait(40);
  ObjectOn(3);
  Wait(10);
  ObjectOn(4);
  Wait(30);
  ObjectOff(2);
  Wait(20);
  ObjectOn(5);
  // ... here! The object 5 won't move!
  MoveObject(5, 166, 72, 6);
  cDude.ChangeRoom(0);
  Wait(40);
  cEgo.ChangeView(1);
  SetGlobalInt(1, 12);
  // Restore region 1 so it works again the next time player enters the room
  EnableRegion(1);
  // In the end, the player ends in room 666
  cEgo.ChangeRoom(666, 105, 142);
  }
}



EDIT: BAH! I've been using old and non working commands in my script again! This problem solved itself after a good night's sleep and some newer commands (oObject5.Move(138, 98, 6, eBlock, eAnywhere)). Sorry for wasting your time.
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

WHAM

Is there a way to SILENCE music in AGS games without stopping it and having it restart again when you restore it. I need to have a moment of silence in my game, but my music track is almost 30 minutes long and I dont want to have to restart it...

Also: can you play another music on top of the first, or do I have to have the second music simply as a SOUND file instead?
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Khris


WHAM

So I thought. Thanks! I hereby promise that I wont be bothering you again in a long time, as my first game is finelly about to be released within two weeks from now!

You guys have been a great help! Thank you all.
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

WHAM

I'm having a pretty big problem here, and was hoping that someone might have an idea on how to solve it:

I have about 700 character.Say commands throughtout my game. Three different characters, all character.Say commands have a line of voice acting(mp3) attached to them.

The problem is this: Some lines of voice acting are halted right at the end, so that the timer never kicks in and automatically ends the say command. The voice just stops at the end and the text floating above the character's head stay's there until the player klicks on presses a key.

Could this be because of overusing repeatedly execute? It's the only thing that came to my mind...

The problem only presents itself with certain character.Say commands and always in the same way. The mp3 files seem to be ok and run normally in all other programs (winamp, windows media player, audacity).
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

WHAM

A new game in the making, a new issue to tackle:

If you've played Resident evil 4, you will remember the active cutscenes in the game. I'm looking to replicate these in an AGS game.

The idea is as follows: A cutscene runs in the game, then is halted in a certain phase and the player is prompted for input. If the user gives the correct input quickly enough, the game responds, if not, the game responds differently (for example, the player was too slow to dodge a bullet, gets hit and dies instantly).

HOW can you make this? How do I stop a cutscene and wait for the player to react, how do I create a timer like this? If someone could give me a basic idea to build on, I'd be ever grateful.
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Khris

Code: ags
// cutscene code

  int seconds = 2;  // two seconds to react

  Overlay*o = Overlay.CreateTextual(..., "PRESS SPACE!");

  int timer;
  int button;
  while(timer<seconds*GetGameSpeed()) {
    if (IsKeyPressed(' ')) button = 1;
    Wait(1);
    timer++;
  }

  o.Remove();

  if (button) {
    // continue cutscene
  }
  else {
    // kill player
  }

WHAM

Wow... I mean just... wow... This is why I love this forum...

Thanks Khris, I'll be experimenting when I get home from work in a few hours...

Wow...

...damn!...
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

WHAM

Bringing this thread up again, as now that I've actually started to implement the script Khris gave me in his last post (Christ! It's been MONTHS!), I realized that the script is not quite cutting it due to the following reason: you can only have it set on one second intervals, instead of giving it the amount of time for the player to react in either fractions of a second, or in game loops.

Any good ideas on how to remedy this, all I've gotten in my attempts has been a bunch of "cannot convert to int" etc. errors...

Thanks again in advance!
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Calin Leafshade

the

Code: ags

while(timer<seconds*GetGameSpeed())


part is converting game loops to seconds.

just replace that while statement with the number of game loops you want to wait.

WHAM

Quote from: Calin Leafshade on Fri 01/01/2010 22:06:21
the

Code: ags

while(timer<seconds*GetGameSpeed())


part is converting game loops to seconds.

just replace that while statement with the number of game loops you want to wait.


Wait, what? Can you give me a code example where the game waits for, lets say 20 game loops (1/2 of a second), please? I'm afraid I didn't quite understand what you just said...  :-\
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Dualnames

#96
Quote from: WHAM on Fri 01/01/2010 23:01:07
Quote from: Calin Leafshade on Fri 01/01/2010 22:06:21
the

Code: ags

while(timer<seconds*GetGameSpeed())


part is converting game loops to seconds.

just replace that while statement with the number of game loops you want to wait.



Wait, what? Can you give me a code example where the game waits for, lets say 20 game loops (1/2 of a second), please? I'm afraid I didn't quite understand what you just said...  :-\

Code: ags

while(timer<40) //If 40 is the time you want to wait for input.


You said you want for example to dodge a bullet in a certain time period. That time period is represented by the number 40. Ideally you can have a global variable instead of 40 and adjust time period for every alike scene.

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

WHAM

Quote from: Dualnames on Fri 01/01/2010 23:08:03
Quote from: WHAM on Fri 01/01/2010 23:01:07
Quote from: Calin Leafshade on Fri 01/01/2010 22:06:21
the

Code: ags

while(timer<seconds*GetGameSpeed())


part is converting game loops to seconds.

just replace that while statement with the number of game loops you want to wait.



Wait, what? Can you give me a code example where the game waits for, lets say 20 game loops (1/2 of a second), please? I'm afraid I didn't quite understand what you just said...  :-\

Code: ags

while(timer<40) //If 40 is the time you want to wait for input.


Yopu said you want for example to doge a bullet in a certain time period. That time period is represented by the number 40. Ideally you can have a global variable instead of 40 and adjust time period for every alike scene.



Aaaaaa! Now that I see it written, I get it. Thanks a lot to you both!
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

SMF spam blocked by CleanTalk