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

#101
You'll have to break the references. :embarrassed:
Copy -> special paste -> values only, then sort.
#102
Yes, you have to distribute the file audio.vox that is in your compile folder with the exe. Basically, all file in your compile folder should be distributed with your exe, usually in a zip archive.
#103
Lema Sabachthani
A short interactive fiction made for the MAGS February 2014:
Fictional Spirituality



You have been sentence to death. But what you had done had to be done...

Available in English, French and Spanish.
The game is available since a few month, but I just published a sightly improved version, so I though it was the occasion to talk about it here.
This post-MAGS version contain only minor additions to the original version:
- now with talking animations!
- main character has now a interacting animation.
- addition of a small outro text.
- addition of one useless interaction.

If you haven't play the game in April, the release of this sightly improved version is a good time to give it a try. :)

Sources and ressources for the game can be found in this archive (~17Mo, open the project with AGS 3.3.0 or higher, you'll need this magical plugin).
Graphics, music and code are free to use (let says they are on CC0). :)
Sounds effects are under their respective licenses (from freesound.org, see SoundLicences.txt).

Thanks:
SpriteFont plugin by Calin Leafshade
FichierParametres module by Kitai
Beta test: Valoulef and Atavismus
English proofreading: Straydogstrut
Spanish translation: cireja
Sintony font by Eduardo Tunni
Piano by Pidem
Sound effects from Freesound.org (see SoundLicences.txt file)
#104
Awesome, Khris! Good luck with it.
#105
Yes there is. Use Game.ChangeTranslation function (not documented in the wiki, thought. I'll correct that tonight). Much more elegant than aborting the game indeed.
But seriously Mandle, use the Make Default Language method, it is exactly what you where asking for. You might want to backup your game first, but it should work without any trouble. Oh, according to your first post, it doesn't work if you let some lines blank?
#106
Also, Right click on the "translation" file in the project tree -> Make Default Language.
Quote from: AGS---------------------------
Adventure Game Studio
---------------------------
This command will replace all the text in your game with the translations in this file. This means that your current default language will be lost in the process.

Additionally, all your translations will be updated to contain this translation as the source text.

Are you really sure you want to continue?
---------------------------
Yes   No   
---------------------------
#107
That way the character goes exactly where the player has clicked, and not a few pixel upper. It feels way more satisfying as a player (at least in my opinion).
#108
Agreed with Calin.
Furthermore, I hate being that guy, but Unity is closed source and commercial. They can stop making a free version whenever they wish. They can also remove a feature we need if they want.
#109
Here is another module of mine, poorly solving a rare issue but that do the job and that may be useful to some. I'm introducing you:

IsoWalk v1.1
(right click -> download, ~11ko)
For people using AGS for making high resolution games, and having 8 direction loops in there views.

Let's Problem introducing you the issue:
Quote from: Problem1. Usually AGS moves the characters freely in all directions at all possible angles. This can look bad, especially if you use diagonal walkcycles. If, in your animation, the character walks at 45°, but AGS decides to move the character at 55°, it looks really awkward, as if the character is sliding. I know it's a common problem in many adventures, but are there any ways around this?
More precisely, can you limit a character's movement to 8 fixed angles somehow through scripting? I'm not talking about keyboard controls, but point & click. It doesn't look too bad at low resolutions without diagonal walkcycles, but if you make a highres game with smooth animations and diagonal views, it looks plain wrong most of the time.

My module does it (well, mostly).


If the player is in A and walks to B, my module will tell him to go to B through P1. If P1 isn't in a Walkeable Area, it will try P2. If P2 isn't available either, it will give up and will call a normal Walk.
P1 and P2 priority order customizable (see bellow). Diagonals are fixed to 45° (pi/4 radiants).
Obviously, the effect renders better with 8 direction loops, but in can be interesting even with 4 direction loops character (give it a try or another :)).

Usage:
Code: ags
cEgo.IsoWalk(100, 100);
cEgo.IsoWalk(100, 100, eBlock, eAnywhere);

IsoWalkModule.ModuleON = false;
// deactivate the module. IsoWalk will act as normal Walk function. Useful to make this module optional.

IsoWalkModule.MinDistance = 100;
// Min distance in pixel necessary to activate the module, default is 20.

IsoWalkModule.UseAlternateHorizontalPath = true;
IsoWalkModule.UseAlternateVerticalPath = true;
// Waypoint order priority, true is diagonal move first. Default is false.


/! To use this module with the Lightweight BASS Template v2.0 that come with AGS, see this post. /!

By default, the module try to override mouse clicks in eModeWalkTo to call an IsoWalk. To deactivate that behavior, simply replace line 71 in the header :
Code: ags
#define IsoW_HACKWALK true

by :
Code: ags
#define IsoW_HACKWALK false

or delete lines 173 - 183 in the script:
Code: ags
// intercept left clicks in eModeWalkto to order a IsoWalk
function on_mouse_click(MouseButton button) {  
  if (IsoW_HACKWALK) {
    if (button == eMouseLeft) {
      if (Mouse.Mode == eModeWalkto) {
          player.IsoWalk(mouse.x + GetViewportX(), mouse.y + GetViewportY(), eNoBlock, eWalkableAreas);
          ClaimEvent();
      }
    }
  }
}


Caveats: If you are doing some cEgo.Moving checks, be sure to perform them bellow the IsoWalk script (either in a script bellow in the project tree, or in a room script), otherwise it may become false at the middle of the walk.
Due to a bug in the old AGS pathfinder that is called on straight line movement, a few "+3" are lurking around in the script. Should the bug be corrected, those "+3" will be removed.

Header:
Code: ags
// Header for module 'IsoWalk', version 1.1
//
// Author: Billbis & Pidem
//
// Abstract:
//
//   Enforce walking on the 8 standard directions when possible to avoid gliding effects.
//   Contain an alternative walk function (IsoWalk(int x, int y, optional BlockingStyle, optional WalkWhere))
//   Usage: cEgo.IsoWalk(100,100);
//   By default, hacks mouse click in WalkTo mode to perform a player.IsoWalk().
//   
// Dependencies:
//
//   AGS version required:  build for AGS 3.2.1 and 3.3.0, not sure if it works with older versions.
//
//   AGS setting required: No particular configuration is needed. Not very useful if you do not have
//   8 directions in your walking views or if your game is in Low Resolution.
//
// Configuration:
//
//   Optional:
//     
//     IsoW_HACKWALK is define as true.
//     Define it as false to use normal mouse comportment for eModeWalkTo (or delete the corresponding section in IsoWalk Script).
//     
//     IsoWalkModule.moduleON (bool) can be set to false to force IsoWalk to act as normal walk function.
//     (useful to set this module as optional).
//     IsoWalkModule.UseAlternateHorizontalPath and IsoWalkModule.UseAlternateVerticalPath (bool) will change waypoints priorities.
//     (see code comments for details).
//     IsoWalkModule.MinDistance (int) is the minimum distance (in pixel) to activate the module.
//
// Caveats:
//
//   This module works better on large free WalkeableAreas than on small busy ones.
//   If no alternative way is found, characters will use normal walk comportment.
//
// Revision history:
//   verion 1.1: 2014/05/22
//      Optional variables are now encaplusated in a struct.
//   version 1.0: 2014/03/04
//      Name change from Use 8 Direction to IsoWalk. Addition of a few '+3' to avoid a strange comportment of
//      AGS pathfinder.
//      The module now support multi-character non blocking IsoWalks !
//   version beta 0.4: 2013/06/27
//      Bug correction: WA detection now take in account viewport.
//   version beta 0.3: 2013/06/12
//      Addition of Minimal Distance setting.
//   version beta 0.2: 2013/03/08
//      Code cleaning + more customizations possibles.
//   version beta 0.1: 2013/03/03
//      First release.
//  
// License:
//
//   IsoWalk is publish under the terms of the 
//   Do What The Fuck You Want To Public License, Version 2
// 
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What The Fuck You Want
// To Public License, Version 2, as published by Sam Hocevar. See
// http://sam.zoy.org/wtfpl/COPYING for more details.
//
// Thanks:
//
//   Kitai, valoulef


// Defines
//Override Mouse Click in mode WalkTo to use IsoWalk for the main character
#define IsoW_HACKWALK true // $AUTOCOMPLETEIGNORE$

//Struct definition
struct IsoWalkModule {
    
    import static attribute bool ModuleON;
    import static bool get_ModuleON(); // $AUTOCOMPLETEIGNORE$
    import static void set_ModuleON(bool input); // $AUTOCOMPLETEIGNORE$
    
    import static attribute bool UseAlternateHorizontalPath;
    import static bool get_UseAlternateHorizontalPath(); // $AUTOCOMPLETEIGNORE$
    import static void set_UseAlternateHorizontalPath(bool input); // $AUTOCOMPLETEIGNORE$    
    
    import static attribute bool UseAlternateVerticalPath;
    import static bool get_UseAlternateVerticalPath(); // $AUTOCOMPLETEIGNORE$
    import static void set_UseAlternateVerticalPath(bool input); // $AUTOCOMPLETEIGNORE$    
    
    import static attribute int MinDistance;
    import static int get_MinDistance(); // $AUTOCOMPLETEIGNORE$
    import static void set_MinDistance(int input); // $AUTOCOMPLETEIGNORE$
    
};

// Function imports

/// Walk to point (x,y) using only the 8 directions if possible.
import void IsoWalk(this Character*, int x, int y, BlockingStyle = eNoBlock, WalkWhere = eWalkableAreas);

Script:
Code: ags
// IsoWalk module script

//Variables declaration & definition
bool ModuleON = true; //if turn OFF, IsoWalk act as normal Walk. To set the module as an option.
bool UseAlternateHorizontalPath = false; //exchange waypoint priorities. False = vertical / horizontal first
bool UseAlternateVerticalPath = false; //True = diagonal first
int MinDistance = 20; //Minimum distance (in pixel) for the Module to be active.

// struct static definitions
static bool IsoWalkModule::get_ModuleON() {
    return ModuleON;
}
static void IsoWalkModule::set_ModuleON(bool input) {
    ModuleON = input;
}

static bool IsoWalkModule::get_UseAlternateHorizontalPath() {
    return UseAlternateHorizontalPath;
}
static void IsoWalkModule::set_UseAlternateHorizontalPath(bool input) {
    UseAlternateHorizontalPath = input;
}

static bool IsoWalkModule::get_UseAlternateVerticalPath() {
    return UseAlternateVerticalPath;
}
static void IsoWalkModule::set_UseAlternateVerticalPath(bool input) {
    UseAlternateVerticalPath = input;
}

static int IsoWalkModule::get_MinDistance() {
    return MinDistance;
}
static void IsoWalkModule::set_MinDistance(int input) {
    if (input >= 0 && input <= System.ViewportWidth) {
        MinDistance = input;
    }
}

// Stuff for non blocking walk
bool IsoW_noBlock = false; // optimisation of the repeatedly_execute() checks.
int IsoW_x[];
int IsoW_y[];
bool IsoW_eWalkableAreas[];
bool IsoW_character[]; 

function game_start () {
  IsoW_x = new int[Game.CharacterCount];
  IsoW_y = new int[Game.CharacterCount];
  IsoW_eWalkableAreas = new bool[Game.CharacterCount];
  IsoW_character = new bool[Game.CharacterCount];
}

//Functions definition

// Return absolute value
function IsoW_Abs(int x) { 
  if (x >= 0) return x;
  else return -x;
}

// Main module function
void IsoWalk(this Character*, int x, int y, BlockingStyle BStyle, WalkWhere WWhere) { // Alternative walk function. Core of the module.
  int ID = this.ID;
  int DeltaX = IsoW_Abs(x - this.x); //Distances between character and destination
  int DeltaY = IsoW_Abs(y - this.y);
  if ((ModuleON)&& ((DeltaX*DeltaX + DeltaY*DeltaY) > (MinDistance*MinDistance))) { //If Distance > MinDistance (Pythagore)
    int Signe;
    int xP1, xP2, xWP, yP1, yP2, yWP;
    //Calculating Waypoint Coordinates
    if (DeltaX >= DeltaY) { //Diagonal + Horizontal movement needed
      if (this.x - x >= 0) {
        Signe = 1;
      } else {
        Signe = -1;
      }
      if (!UseAlternateHorizontalPath) {
        xP1= x + DeltaY*Signe;  //Waypoint coordiantes
        yP1= this.y;
        xP2= this.x + DeltaY*(-Signe); //Alternative waypoint coordinate
        yP2= y;
      } else {// if IsoW_UseAlternateHorizontalPath P1 <-> P2
        xP1= this.x + DeltaY*(-Signe);  //Waypoint coordiantes
        yP1= y;
        xP2= x + DeltaY*Signe;//Alternative waypoint coordinate
        yP2= this.y;
      }
    } else { //DeltaX < DeltaY Diagonal + Vertical movement needed
      if (this.y - y >= 0) {
        Signe = 1;
      } else {
        Signe = -1;
      }
      if (!UseAlternateVerticalPath) {
        xP1= this.x;  //Waypoint coordiantes
        yP1= y + DeltaX*Signe;
        xP2= x; //Alternative waypoint coordinate
        yP2= this.y + DeltaX*(-Signe);
      } else {// if IsoW_UseAlternateVerticalPath P1 <-> P2
        xP1= x;  //Waypoint coordiantes
        yP1= this.y + DeltaX*(-Signe);
        xP2= this.x; //Alternative waypoint coordinate
        yP2= y + DeltaX*Signe;
      }
    }
    //Walking
    if ( WWhere == eWalkableAreas) {
      if (GetWalkableAreaAt(xP1-GetViewportX(), yP1-GetViewportY()) !=0) { //if P1 is in a WA, we use it
        xWP = xP1 + 3; // +3 are small hacks to force AGS to use Djikstra
        yWP = yP1 + 3;
      } else if (GetWalkableAreaAt(xP2-GetViewportX(), yP2-GetViewportY()) !=0) { //if P2 is in a WA but not P1, we use P2
        xWP = xP2 + 3;
        yWP = yP2 + 3;
      } else { //is not P1 neither P2 are in a WA, then we give up
        xWP = x;
        yWP = y;
      }
      if (BStyle == eBlock) {
        this.Walk(xWP, yWP, eBlock, eWalkableAreas);
        this.Walk(x, y, eBlock, eWalkableAreas);
      } else { //BStyle == eNoBlock
        this.Walk(xWP, yWP, eNoBlock, eWalkableAreas);
        IsoW_x[ID] = x;
        IsoW_y[ID] = y;
        IsoW_character[ID] = true;
        IsoW_eWalkableAreas[ID] = true;
        IsoW_noBlock = true; // 2nd part of the movement in Repeatidly_execute
      }
    } else { // WWhere == eAnywhere
      if (BStyle == eBlock) {
        this.Walk(xP1, yP1, eBlock, eAnywhere);
        this.Walk(x, y, eBlock, eAnywhere);
      } else { //BStyle == eNoBlock
        this.Walk(xP1, yP1, eNoBlock, eAnywhere);
        IsoW_x[ID] = x;
        IsoW_y[ID] = y;        
        IsoW_character[ID] = true;
        IsoW_eWalkableAreas[ID] = false;
        IsoW_noBlock = true; // 2nd part of the movement in Repeatidly_execute
      }
    }
  } else { //if module is OFF, or if too short distance
    this.Walk(x, y, BStyle, WWhere);
  }
}

//Non blocking movement
function repeatedly_execute() {
  if (IsoW_noBlock) {
    int i = 0;
    while (i < Game.CharacterCount) {
      if (IsoW_character[i] == true && character[i].Moving == false) {
        if (IsoW_eWalkableAreas[i]) {
          character[i].Walk(IsoW_x[i], IsoW_y[i], eNoBlock, eWalkableAreas);
        } else {
          character[i].Walk(IsoW_x[i], IsoW_y[i], eNoBlock, eAnywhere);
        }
        IsoW_character[i] = false;
      }
      i++;
    }
    IsoW_noBlock = false;
    i = 0;
    while (i < Game.CharacterCount) {
      if (IsoW_character[i]) {
        IsoW_noBlock = true;
      }
      i++;
    }
  }
}

// intercept left clicks in eModeWalkto to order a IsoWalk
function on_mouse_click(MouseButton button) {  
  if (IsoW_HACKWALK) {
    if (button == eMouseLeft) {
      if (Mouse.Mode == eModeWalkto) {
          player.IsoWalk(mouse.x + GetViewportX(), mouse.y + GetViewportY(), eNoBlock, eWalkableAreas);
          ClaimEvent();
      }
    }
  }
}
#110
Engine Development / Re: Pathfinding bug?
Wed 21/05/2014 14:50:12
Quote from: GurokI could be wrong, but it feels like this chunk of code should try find_route_dijkstra and then *only* if that fails revert to the old pathfinding routine.
Agreed. It will require some testings to be 100% sure, but that is definitely an option.

Another solution that have been proposed was to recode a new pathfinder based on plygons, but obviously that's way more work than changing a boolean in the source code. ;)
#112
For posterity reason (:grin:), I'll repeat here a few things we discussed in PM:

1)
To use my module with the Lightweight BASS Template v2.0 that come with AGS:
-Import the module and put the IsoWalk script upper the TwoClickHandler script in the project tree.
-Line 76 of IsoWalk header, replace:
Code: ags
#define IsoW_HACKWALK true 
by:
Code: ags
#define IsoW_HACKWALK false 

(alternatively, delete this line in the header and line 145-154 in the script body)
-Line 47 of TwoClickHandler script, replace:
Code: ags
ProcessClick(mouse.x, mouse.y, eModeWalkto);
by:
Code: ags
player.IsoWalk(mouse.x+GetViewportX(), mouse.y+GetViewportY(), eNoBlock, eWalkableAreas);

If you aren't doing to many fancy things in your game, it should do the job.

Alternatively, change nothing code-wise, put IsoWalk bellow TwoClickHandler and call a ClaimEvent after each ChangeRoom:
Code: ags
function hDoor_Interact()
{
    player.IsoWalk(935, 610, eBlock);
    player.ChangeRoom(2, 260, 590);
    ClaimEvent();
}


2) If I understand correctly, TheBitPriest has recoded a pathfinder for Heroine's Quest. Was it for addressing the same issue (avoid gliding effect during walks)? How he did it, module, plugin or directly in the AGS source code? Do the HQ team plan to share his work with the community? There solution might be less broken than mine. :-X

3)
I have still no simple idea for your original point 2, despite handling walking in another custom function.
#113
Regarding point 1, which is reported here, it will require somehow (source code, module or plugin) to recode the entire pathfinder to do to it properly.
However I have coded a unperfect module that mostly do the job. It is still in development and still not published in this forum, but I'm using it in my two games, and some French members are also using it. All explanation are present in the header, it simply contain an alternative walk function, and by default intercept clicks in eModeWalkTo.
Download link (~5ko)
Header:
Spoiler
Code: ags
// Header for module 'IsoWalk', version 1.0
//
// Author: Billbis & Pidem
//
// Abstract:
//
//   Enforce walking on the 8 standard directions when possible to avoid gliding effects.
//   Contain an alternative walk function (IsoWalk(int x, int y, optional BlockingStyle, optional WalkWhere))
//   Usage: cEgo.IsoWalk(100,100);
//   By default, hacks mouse click in WalkTo mode to perform a player.IsoWalk().
//  
// Dependencies:
//
//   AGS version required:  build for AGS 3.2.1 and 3.3.0, not sure if it works with older versions.
//
//   AGS setting required: No particular configuration is needed. Not very useful if you do not have
//   8 directions in your walking views.
//
// Configuration:
//
//   Optional:
//    
//     IsoW_HACKWALK is define as true.
//     Define it as false to use normal mouse comportment for eModeWalkTo (or delete the corresponding section in IsoWalk Script).
//    
//     You can import a few variables to do some customizations. (Uncomment these following lines)

/*
import bool IsoW_moduleON;
import bool IsoW_UseAlternateHorizontalPath;
import bool IsoW_UseAlternateVerticalPath;
import int IsoW_MinDistance;
*/

//     IsoW_moduleON can be set to false to force IsoWalk to act as normal walk function.
//     (useful to set this module as optional).
//     IsoW_UseAlternateHorizontalPath and IsoW_UseAlternateVerticalPath will change waypoints priorities.
//     (see code comments for details).
//     IsoW_MinDistance is the minimum distance (in pixel) to activate the module.
//
// Caveats:
//
//   This module works better on large free WalkeableAreas than on small busy ones.
//   If no alternative way is found, characters will use normal walk comportment.
//
// Revision history:
//   version 1.0: 2014/03/04
//      Name change from Use 8 Direction to IsoWalk. Addition of a few '+3' to avoid a strange comportment of
//      AGS pathfinder.
//      The module now support multi-character non blocking IsoWalks !
//   version beta 0.4: 2013/06/27
//      Bug correction: WA detection now take in account viewport.
//   version beta 0.3: 2013/06/12
//      Addition of Minimal Distance setting.
//   version beta 0.2: 2013/03/08
//      Code cleaning + more customizations possibles.
//   version beta 0.1: 2013/03/03
//      First release.
//  
// License:
//
//   IsoWalk is publish under the terms of the
//   Do What The Fuck You Want To Public License, Version 2
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What The Fuck You Want
// To Public License, Version 2, as published by Sam Hocevar. See
// http://sam.zoy.org/wtfpl/COPYING for more details.
//
// Thanks:
//
//   Kitai, valoulef
//
// Defines
#define IsoW_HACKWALK true //Override Mouse Click in mode WalkTo to use IsoWalk for the main character
//
// Function imports

/// Walk to point (x,y) using only the 8 directions if possible.
import void IsoWalk(this Character*, int x, int y, BlockingStyle = eNoBlock, WalkWhere = eWalkableAreas);
[close]
Script:
Spoiler
Code: ags
// IsoWalk module script
//Variables declaration & definition
bool IsoW_moduleON = true; //if turn OFF, IsoWalk act as normal Walk. To set the module as an option.

bool IsoW_UseAlternateHorizontalPath = false; //exchange waypoint priorities. False = vertical / horizontal first
bool IsoW_UseAlternateVerticalPath = false; //True = Diagonnale first

int IsoW_MinDistance = 20; //Minimum distance (in pixel) for the Module to be active.

// Stuff for non blocking walk
bool IsoW_noBlock = false; // optimisation of the repeatedly_execute() checks.
int IsoW_x[];
int IsoW_y[];
bool IsoW_eWalkableAreas[];
bool IsoW_character[];

function game_start () {
  IsoW_x = new int[Game.CharacterCount];
  IsoW_y = new int[Game.CharacterCount];
  IsoW_eWalkableAreas = new bool[Game.CharacterCount];
  IsoW_character = new bool[Game.CharacterCount];
}

//Functions definition

// Return absolute value
function IsoW_Abs(int x) {
 if (x >= 0) return x;
  else return -x;
}

// Main module function
void IsoWalk(this Character*, int x, int y, BlockingStyle BStyle, WalkWhere WWhere) { // Alternative walk function. Core of the module.
  int ID = this.ID;


  int DeltaX = IsoW_Abs(x - this.x); //Distances between character and destination
  int DeltaY = IsoW_Abs(y - this.y);
  if ((IsoW_moduleON)&& ((DeltaX*DeltaX + DeltaY*DeltaY) > (IsoW_MinDistance*IsoW_MinDistance))) { //If Distance > MinDistance (Pythagore)
    int Signe;
    int xP1, xP2, xWP, yP1, yP2, yWP;
    //Calculating Waypoint Coordinates
    if (DeltaX >= DeltaY) { //Diagonal + Horizontal movement needed
      if (this.x - x >= 0) {
        Signe = 1;
      } else {
        Signe = -1;
      }
      if (!IsoW_UseAlternateHorizontalPath) {
        xP1= x + DeltaY*Signe;  //Waypoint coordiantes
        yP1= this.y;
        xP2= this.x + DeltaY*(-Signe); //Alternative waypoint coordinate
        yP2= y;
      } else {// if IsoW_UseAlternateHorizontalPath P1 <-> P2
        xP1= this.x + DeltaY*(-Signe);  //Waypoint coordiantes
        yP1= y;
        xP2= x + DeltaY*Signe;//Alternative waypoint coordinate
        yP2= this.y;
      }
    } else { //DeltaX < DeltaY Diagonal + Vertical movement needed
      if (this.y - y >= 0) {
        Signe = 1;
      } else {
        Signe = -1;
      }
      if (!IsoW_UseAlternateVerticalPath) {
        xP1= this.x;  //Waypoint coordiantes
        yP1= y + DeltaX*Signe;
        xP2= x; //Alternative waypoint coordinate
        yP2= this.y + DeltaX*(-Signe);
      } else {// if IsoW_UseAlternateVerticalPath P1 <-> P2
        xP1= x;  //Waypoint coordiantes
        yP1= this.y + DeltaX*(-Signe);
        xP2= this.x; //Alternative waypoint coordinate
        yP2= y + DeltaX*Signe;
      }
    }
    //Walking
    if ( WWhere == eWalkableAreas) {
      if (GetWalkableAreaAt(xP1-GetViewportX(), yP1-GetViewportY()) !=0) { //if P1 is in a WA, we use it
        xWP = xP1 + 3; // +3 are small hacks to force AGS to use Djikstra
        yWP = yP1 + 3;
      } else if (GetWalkableAreaAt(xP2-GetViewportX(), yP2-GetViewportY()) !=0) { //if P2 is in a WA but not P1, we use P2
        xWP = xP2 + 3;
        yWP = yP2 + 3;
      } else { //is not P1 neither P2 are in a WA, then we give up
        xWP = x;
        yWP = y;
      }
      if (BStyle == eBlock) {
        this.Walk(xWP, yWP, eBlock, eWalkableAreas);
        this.Walk(x, y, eBlock, eWalkableAreas);
      } else { //BStyle == eNoBlock
        this.Walk(xWP, yWP, eNoBlock, eWalkableAreas);
        IsoW_x[ID] = x;
        IsoW_y[ID] = y;
        IsoW_character[ID] = true;
        IsoW_eWalkableAreas[ID] = true;
        IsoW_noBlock = true; // 2nd part of the movement in Repeatidly_execute
      }
    } else { // WWhere == eAnywhere
      if (BStyle == eBlock) {
        this.Walk(xP1, yP1, eBlock, eAnywhere);
        this.Walk(x, y, eBlock, eAnywhere);
      } else { //BStyle == eNoBlock
        this.Walk(xP1, yP1, eNoBlock, eAnywhere);
        IsoW_x[ID] = x;
        IsoW_y[ID] = y;        
        IsoW_character[ID] = true;
        IsoW_eWalkableAreas[ID] = false;
        IsoW_noBlock = true; // 2nd part of the movement in Repeatidly_execute
      }
    }
  } else { //if module is OFF, or if too short distance
    this.Walk(x, y, BStyle, WWhere);
  }
}

//Non blocking movement
function repeatedly_execute() {
  if (IsoW_noBlock) {
    int i = 0;
    while (i < Game.CharacterCount) {
      if (IsoW_character[i] == true && character[i].Moving == false) {
        if (IsoW_eWalkableAreas[i]) {
          character[i].Walk(IsoW_x[i], IsoW_y[i], eNoBlock, eWalkableAreas);
        } else {
          character[i].Walk(IsoW_x[i], IsoW_y[i], eNoBlock, eAnywhere);
        }
        IsoW_character[i] = false;
      }
      i++;
    }
    IsoW_noBlock = false;
    i = 0;
    while (i < Game.CharacterCount) {
      if (IsoW_character[i]) {
        IsoW_noBlock = true;
      }
      i++;
    }
  }
}

function on_mouse_click(MouseButton button) {  // intercept left clicks in eModeWalkto to order a IsoWalk
  if (IsoW_HACKWALK) {
    if (button == eMouseLeft) {
      if (Mouse.Mode == eModeWalkto) {
          player.IsoWalk(mouse.x + GetViewportX(), mouse.y + GetViewportY(), eNoBlock, eWalkableAreas);
          ClaimEvent();
      }
    }
  }
}

//You may want to import these in (see Header)
export IsoW_moduleON, IsoW_UseAlternateHorizontalPath, IsoW_UseAlternateVerticalPath, IsoW_MinDistance;
[close]
Usage:
Code: ags
cEgo.IsoWalk(x, y, optional BlockingStyle, optional WalkWhere)

#114
I am not sure I should denounce him, but some times ago Kitai has made a module to use Regular Expressions within AGS. :=
http://adventuregamestudio.fr-bb.com/t2162-expressions-regulieres
#115
You can copy transparency mask from the original sprite into a full white dynamic sprite, then assign this sprite to the character.
I do not have access to AGS right now, so I can't help with the syntax.
#116
Congratulation HanaIndiana !
:)
#117
Did you link the function with the event panel of the corresponding room ? You have to.
#118
Editor Development / Re: Bug report
Wed 05/03/2014 22:33:35
Hey, many thanks for the tip. ;-D
#119
Editor Development / Re: Bug report
Wed 05/03/2014 20:29:25
Not sure where to post this, so I'll try here. Should I have put this on the Bug and Suggestion Tracker instead ?
I am encountering a very serious bug with AGS 3.3.0 (Build 3.3.0.1156). Can someone try to reproduce it to see if it comes from my configuration (win7 64) ?
1) Open AGS editor.
2) Create a new game, default template
3) Create a new script
4) Open the header
5) Start writing in line 2:
Code: ags
#define 

6) The moment you finish writing:
Quote from: Unhandled errorError: L'index se trouve en dehors des limites du tableau.
Version: AGS 3.3.0.1156

System.IndexOutOfRangeException: L'index se trouve en dehors des limites du tableau.
   Ã Â  AGS.Editor.AutoComplete.ProcessPreProcessorDirective(List`1 defines, FastString& script, AutoCompleteParserState state)
   Ã Â  AGS.Editor.AutoComplete.ConstructCache(Script scriptToCache, Boolean isBackgroundThread)
   Ã Â  AGS.Editor.ScriptEditor.scintilla_OnBeforeShowingAutoComplete(Object sender, EventArgs e)
   Ã Â  AGS.Editor.ScintillaWrapper.ShowAutoComplete(Int32 charsTyped, String autoCompleteList)
   Ã Â  AGS.Editor.ScintillaWrapper.ShowAutoCompleteIfAppropriate(Int32 minimumLength)
   Ã Â  AGS.Editor.ScintillaWrapper.OnUpdateUI(Object sender, EventArgs e)
   Ã Â  Scintilla.ScintillaControl.DispatchScintillaEvent(SCNotification notification)
   Ã Â  Scintilla.ScintillaControl.WndProc(Message& m)
   Ã Â  System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   Ã Â  System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   Ã Â  System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Quote from: save changes---------------------------
Adventure Game Studio
---------------------------
A serious error occurred and the AGS Editor may now be in an unstable state. You are STRONGLY ADVISED to shut down the editor and restart it. Before saving your work, make a backup copy of your game folder in case any data has been corrupted.



Error: System.IndexOutOfRangeException: L'index se trouve en dehors des limites du tableau.

   Ã Â  AGS.Editor.AutoComplete.ProcessPreProcessorDirective(List`1 defines, FastString& script, AutoCompleteParserState state)

   Ã Â  AGS.Editor.AutoComplete.ConstructCache(Script scriptToCache, Boolean isBackgroundThread)

   Ã Â  AGS.Editor.ScriptEditor.scintilla_OnBeforeShowingAutoComplete(Object sender, EventArgs e)

   Ã Â  AGS.Editor.ScintillaWrapper.ShowAutoComplete(Int32 charsTyped, String autoCompleteList)

   Ã Â  AGS.Editor.ScintillaWrapper.ShowAutoCompleteIfAppropriate(Int32 minimumLength)

   Ã Â  AGS.Editor.ScintillaWrapper.OnUpdateUI(Object sender, EventArgs e)

   Ã Â  Scintilla.ScintillaControl.DispatchScintillaEvent(SCNotification notification)

   Ã Â  Scintilla.ScintillaControl.WndProc(Message& m)

   Ã Â  System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   Ã Â  System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   Ã Â  System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
---------------------------
OK   
---------------------------
And when you close the game without saving:
Quote---------------------------
Save changes?
---------------------------
Files have been added, removed or renamed. If you don't save the game now, you may not be able to successfully open this game next time. Do you want to save your changes?
---------------------------
Oui   Non   
---------------------------
If you click on yes, it can corrupt your game file. If you click on no, it seems to be ok.
#120
Voted! That was an hard choice, because I like all the entries. (laugh)
SMF spam blocked by CleanTalk