Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: SSH on Tue 28/11/2006 17:24:50

Title: MODULE: Downhill v1.03 - Walk behind hills
Post by: SSH on Tue 28/11/2006 17:24:50
Following on from the issues in this thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=29187.0), here is SSH's downhill module...

Lets you set some walkable areas as downhills, and assign Z values to walkable areas and walkbehinds, to let characters walk away from camera while actually increasing their Y.

Requires AGS 2.72

Download the Downhill module (http://ssh.me.uk/modules/Downhill.zip)
Documentation for Downhill module (http://ssh.me.uk/moddoc/Downhill.zip)
Module wiki page (http://americangirlscouts.org/agswiki/Downhill)
Title: Re: MODULE: Downhill v1.0
Post by: fovmester on Tue 28/11/2006 22:18:24
Very neat, SSH! I've done some downhills, but it is a pain to make up a new script every time. This module will surely be used by many people!
Title: Re: MODULE: Downhill v1.01
Post by: Da_Elf on Tue 28/11/2006 23:49:11
one last bug. once you leave the room containing that you have left the walkbehinds deactivated. basically when i went into other rooms after my hill room none of the walkbehinds worked anymore.
Title: Re: MODULE: Downhill v1.02
Post by: SSH on Wed 29/11/2006 10:09:55
Ah, OK. My test game didn't have this problem, as you could only leave the room from the frontmost walkable area which didn't mess with baselines anyway. I've fixed this in v1.02 which is up now.
Title: Re: MODULE: Downhill v1.02
Post by: Da_Elf on Wed 29/11/2006 11:13:41
well. from what i can see its perfect now. lets hope we dont needs to see a version 1.03
Title: Re: MODULE: Downhill v1.02 - Walk behind hills
Post by: Da_Elf on Thu 21/12/2006 15:29:27
id hate to have to bring something else up. but if you have some characters who have only one loop and you dont have up and down loops to be swapped then you get a crash. Is there any way for it to swap the loops if the loops are available.
Title: Re: MODULE: Downhill v1.02 - Walk behind hills
Post by: SSH on Thu 21/12/2006 15:31:31
I might do that, but why not just create a dummy up loop the same as the single loop?
Title: Re: MODULE: Downhill v1.02 - Walk behind hills
Post by: Da_Elf on Thu 21/12/2006 15:44:49
thats what i had to do. for all the characters i had to make sure they all had an up loop.( even if it was just a blue cup)
Title: Re: MODULE: Downhill v1.02 - Walk behind hills
Post by: SSH on Fri 16/02/2007 13:18:38
I've fixed this problem an uploaded v1.03
Title: Re: MODULE: Downhill v1.03 - Walk behind hills
Post by: Da_Elf on Fri 16/02/2007 14:03:11
ooo. thats cool. will i have to change any script in my rooms or is it just the odule i should replace?
Title: Re: MODULE: Downhill v1.03 - Walk behind hills
Post by: SSH on Fri 16/02/2007 14:03:58
Just replace the module, I think.
Title: Re: MODULE: Downhill v1.03 - Walk behind hills
Post by: Da_Elf on Mon 26/02/2007 15:19:44
BTW forgot to say thanks a hell of alot for this module
Title: Re: MODULE: Downhill v1.03 - Walk behind hills
Post by: Ali on Fri 12/03/2010 22:57:22
I just tried to get this working in AGS 3.1.2, and perhaps because AGS has had some of it's limitations removed a few tiny changes needed to be made:

In the first 25 lines of script, the following need to be replaced:

AGS_MAX_CHARACTERS

AGS_MAX_FRAMES_PER_LOOP

I guess they need to be replaced with a number bigger then the number of characters in your game, and a number bigger than the maximum number of frames used in a loop. Just typing 1000 in their place got the demo working perfectly for me.
Title: Re: MODULE: Downhill v1.03 - Walk behind hills
Post by: monkey0506 on Sat 13/03/2010 20:27:45
The values can be the same as the number of characters/loops present in the game, but if the value is any smaller then it won't work with all characters/loops. Depending on SSH's implementation it shouldn't produce any run-time errors or crashes (though it might) but would just be unavailable for those items.

Note to SSH:

Back when the limits on characters and other items was removed I found a workaround that might be useful to you:

// AGS 2.72 and earlier
int SomeArray[AGS_MAX_CHARACTERS];


Becomes:

// all versions of AGS
#ifdef AGS_SUPPORTS_IFVER
  #ifver 3.0
    #ifdef AGS_MAX_CHARACTERS // this shouldn't be defined, but just in case
      #undef AGS_MAX_CHARACTERS
    #endif
    #define AGS_MAX_CHARACTERS // don't supply any actual value
    #define IS_AGS_3
  #endif
#endif
int SomeArray[AGS_MAX_CHARACTERS];

function game_start() {
  #ifdef IS_AGS_3
  SomeArray = new int[Game.CharacterCount];
    #undef AGS_MAX_CHARACTERS
    #define AGS_MAX_CHARACTERS Game.CharacterCount // for use in conditionals, loops, etc.
  #endif
}

// end of script

#ifdef IS_AGS_3
  #undef IS_AGS_3
  #undef AGS_MAX_CHARACTERS
#endif


Noting of course that this method does not work with arrays inside of a custom struct since they cannot currently contain dynamic arrays. For that you would have to remove the array from the struct (possibly using multidimensional array indexing if needed).

It's a lot more work to do this than it was in older versions of AGS, but this method makes it backward compatible without having to rewrite large portions of your script.
Title: Re: MODULE: Downhill v1.03 - Walk behind hills
Post by: AnasAbdin on Fri 05/08/2011 12:57:46
Thanx all  ;D
Title: Re: MODULE: Downhill v1.03 - Walk behind hills
Post by: Ali on Mon 19/03/2012 00:40:00
I may be the only person interested in this but... I'm having trouble adapting the module to flip diagonal frames as well as up and down.

Wherever there is an up I've added an upleft and an upright, and the same for down, but I'm getting an error I don't understand:

I'm told there is an invalid loop specified in the function flip_me(Character *who, bool normal):


    ViewFrame *up=Game.GetViewFrame(who.View, 3, pass);
    ViewFrame *upleft=Game.GetViewFrame(who.View, 7, pass);  /// Invalid loop HERE
    ViewFrame *upright=Game.GetViewFrame(who.View, 5, pass);
    ViewFrame *down=Game.GetViewFrame(who.View, 0, pass);
    ViewFrame *downleft=Game.GetViewFrame(who.View, 6, pass);
    ViewFrame *downright=Game.GetViewFrame(who.View, 4, pass);


I don't understand that, because loop 7 is the upleft view. Any suggestions? I'll post the whole module if that's helpful.

Thanks,

Ali
Title: Re: MODULE: Downhill v1.03 - Walk behind hills
Post by: Monsieur OUXX on Fri 31/10/2014 19:23:03
Sorry to dig out the thread.

MIRROR TO VERSION 1.03 ! http://duals.agser.me/Modules/Downhill_v1.03.rar [thanks to Dualnames]
(all older links are broken)

My personal version 1.04 https://www.dropbox.com/s/5uc9lnqgg7ardcd/Downhill%20v1.04.zip?dl=0
Version 1.04 notes :
- I upgraded from 2.x to 3.2.1, then from 3.2.1 to 3.3.0 RC1. It works like a charm.
- I re-defined macros that were missing since they disappeared from AGS
- I objectified the module ( DownHill.Functions(...) )
Overall, I almost didn't change anything, it was working out-of-the-box!