TEMPLATE: 9-verb MI-style 1.6.4 - Last update: 4th April 2019

Started by abstauber, Thu 17/09/2009 16:16:37

Previous topic - Next topic

abstauber

Quote- I have based my work on the version that's included in 3.3.0 RC1

Y U NO TAKE THE RECENT VERSION?!
..and I just had to steal that meme ;)

Anyway, thanks for your work, I'll merge those in the next release. About the clumsy design choice: I agree that it's awkward but it exactly mimics the SCUMM behavior. I actually replayed MI2 to the prison cell to see how they handle envelopes. In SCUMM games you can just "use" and "look at" items (or give them away).
I'll see what I can do about the pick-up bug.

--edit:
I just browsed through the code and it seems like a design choice. Why would you want to pick something up that you already have in your inventory?
You can find it "on_mouse_click"
Code: ags

    //left click in inventory
    else if (button==eMouseLeftInv) {
      if (!isAction(eGA_GiveTo))ItemGiven= null;
   
      if (GlobalCondition (1)) {
        // if the mouse is in the inventory and modes Walk or pickup are selected
        SetAction (eGA_Use);


Should we really be able to pick up  already taken inventory items?

Monsieur OUXX

OK.
No, imho you can leave "pick up" as "use". It was just the combination of that with "open envelope" that utterly confused me, not to mention the same behavious I spotted in that Italian game which made it even more confusing (since I don't speak Italian, lol)
 

abstauber

Alright, I keep things as they are and just incorporate the 32bit update.

Monsieur OUXX

Quote from: abstauber on Wed 22/04/2015 09:06:21
and just incorporate the 32bit update.
Even that you don't need. After discussion with CW, it turns out there was a misunderstanding, and the priority was to upgrade the 8-bit sprites from the Default Game, not all non-32-bits sprites. 16-bits sprites are alright.
What you can do, though, is just to change the game defaults to 32-bits with Direct3D9. And if you do that I'd recommend re-importing the backgrounds.
 

Crimson Wizard

Abstauber, I found a mistake in this module:
Code: ags

function EnterRoom(this Character*, int newRoom, int x, int y, eDirection dir, bool onWalkable) {
  this.ChangeRoom(newRoom, x, y);
  if (onWalkable) this.PlaceOnWalkableArea();
  this.FaceDirection(dir);
}

The "onWalkable" parameter has no sense here, because room is changed only after the script finishes, and the player will be placed on walkable area in current room, not in the next one.

abstauber

Thanks for the heads up. I have fixed this among other things:

1.5    support for AGS 3.4
       added custom dialog rendering
       adapted eDirection to enum CharacterDirection (and removed eDir_none)
       fixed talk-to and pickup interactions on inv items

Since there are quite a few code changes, this might not yet be 100% stable.

Download
http://shatten.sonores.de/wp-content/uploads/2015/07/9-verb_MI-style_15_RC1.zip

PS: do you think it's a good idea to include custom dialog rendering?

abstauber

Well, since nobody joined the discussion, I suppose custom dialog rendering is alright :P

Also I've opened a github repo hoping that this makes it easier for CW to include the template in the main releases. Not to mention that bugs can be fixed directly in the repo :)

https://github.com/dkrey/ags_9verb_template/tree/master


Crimson Wizard

Quote from: abstauber on Fri 10/07/2015 13:50:12
Also I've opened a github repo hoping that this makes it easier for CW to include the template in the main releases.
Frankly, it is easier for me when I may download ready template (*.agt) from somewhere.

Regarding the repository, I have an advice to not put any output files into repository. There is a number of reasons I could mention:
1) extra size;
2) you create a potential for inconsistent state where you may update source files (like script) but forget to update compiled game;
3) the output files are always built with particular version of AGS, while sources can be used by many different ones; so having executables there makes little sense;
4) since this is a source of template, not a real game, executables are not needed to anyone anyway.

I advise to re-create the repository from scratch and add only the files required to load and compile project, e.g. no temporary files, no output files.
(I say "re-create", because even if you delete exes from this one now, they will still be kept in commits history and take space; it will be easy to do because the repository is recently created)
To tell Git which files not to upload, edit ".gitignore" file in repository, adding names of such files or whole subdirectories, containing output (like "Compiled" and "_Debug").

Files you do not need in repository:
Compiled folder --- this is output
_Debug folder --- this is output
Game.agf.bak --- this is a temporary generated backup file, which you do not need because you use source control.
Game.agf.user --- these are generated user settings saved for each individual project location.
backup_acsprset.spr --- backup file

abstauber

Hey, thanks for the advice.

About the .agt:
do you need two files: one for 3.3x and one compiled for 3.4x or can I stay lazy and just create an .agt with the recent stable version?

cianty

I just had a look at AGS 3.4.0.5. There are a couple of problems with my (admittedly old version of) the template. I don't think there is a sensible way of upgrading and I was wondering how they were fixed in the latest version of the template.

FaceDirection
In 3.4.0.5 this function is introduced and it conflicts with the one from the template. I can easily just remove it from the template, but the problem is: I used this function all over my project and the enums differ. The template uses eDir_Up - 3.4 uses eDirection. I thought about using defines to fix this:
#define eDir_Up eDirectionUp

This will work for my project but only because I don't any of the other functions that use the direction enum, such as on_enter_room. The defines would break it for those calls.

ProcessClick
This function is no longer global as of 3.4.0.5. Instead use Room.ProcessClick. Fortunately there is a option in the Global Settings ("Enforce object-based scripting") that can be set to false to prevent this from breaking the entire guy script. But that's not a good solution for the future. Will the entire script have to be rewritten because of this? Is there a clever fix?
ca. 70% completed

abstauber

Hey, first of all: hooray for deciding to continue on your game :cheesy:

ProcessClick That's indeed just changing everything in guiscript.asc to Room.ProcessClick

FaceDirection Here lies a bit more work ahead. First change the enum to:
Code: ags

// for compatibility reasons
enum eDirection {
  eDir_None  = 0, 
  eDir_Up    = eDirectionUp, 
  eDir_Left  = eDirectionLeft, 
  eDir_Right = eDirectionRight, 
  eDir_Down  = eDirectionDown
};


Now you need to change every function that includes eDirection (such as EnterRoom,GoToCharacter and so on) to the enum CharacterDirection. This goes for guiscript.ash as well as guiscript.asc

So for example:
Code: ags

import function EnterRoom(this Character*, int newRoom, int x, int y, eDirection dir);

needs to be
Code: ags

import function EnterRoom(this Character*, int newRoom, int x, int y, CharacterDirection dir);

That should do the trick.

Btw. a few month ago I migrated Aeronuts to the latest GUI and it wasn't such a big deal, the room files went completely untouched.
The only annoying part was that I had to put some effort in the options GUI. You should create a temp copy of your game and try it yourself. It really isn't that hard.


cianty

Thanks a lot for this little upgrade guide! I will definately follow it as soon as a stable version for 3.4 is released.

Maybe your guide will be interesting for others as well? Maybe it would be a good idea to link to it in the 3.4. release thread?
ca. 70% completed

tobulos1

Hi! Nice work on the template, appreciate it!
Although, I am receiving an error after the update:
Code: ags
guiscript.asc(1385): Error (line 1385): undefined symbol 'inventory'


Should be noted that I have just exported/imported the updated scripts to my current game.
Any thoughts?

abstauber

Hey, nice to see that there are still some 9 verb projects in the makeing :)
Could you please tell me the version of AGS you are currently using? Did you update AGS as well as the script?

At least in AGS 3.3.3 and AGS 3.4.0.5 the inventory array is still there, so I need some more info.

tobulos1

Quote from: abstauber on Tue 14/07/2015 22:27:00
Hey, nice to see that there are still some 9 verb projects in the makeing :)
Could you please tell me the version of AGS you are currently using? Did you update AGS as well as the script?

At least in AGS 3.3.3 and AGS 3.4.0.5 the inventory array is still there, so I need some more info.

Oh, of course! Sorry.
I updated the template and the editor to 3.3.4. Should I try with 3.4.0.5?

Thanks!

Crimson Wizard

#195
Well, there are errors in this template :(.

Started fresh game with 1.5 RC1.

Quote
Dialog 0(36): Dialog has no option number 6
Dialog 0(37): The command 'return' will be ignored since the script for this option has already finished
Dialog 0(38): Dialog has no option number 7
Dialog 0(39): The command 'return' will be ignored since the script for this option has already finished
Dialog 0(40): Dialog has no option number 8
Dialog 0(41): The command 'return' will be ignored since the script for this option has already finished


Quote from: tobulos1 on Tue 14/07/2015 19:59:24
Although, I am receiving an error after the update:
Code: ags
guiscript.asc(1385): Error (line 1385): undefined symbol 'inventory'


This is very strange. "inventory" is a built-in global variable, it must be there, unless its a bug in AGS.
Can you tell, what would happen if you try using this variable somewhere in your script?

Maybe trying "Rebuild All files" may help?

abstauber

Huge apologies for this one. To test scrolling in the dialog gui I added dummy dialog options and removed them afterwards. But unfortunately I forgot to remove the traces in the dialog script itself.

@tobulus1: your version is alright, I just wondered why the inventory array causes trouble. The so called undefined symbol is an internal AGS variable which us just being used by the template. If you upload the sources of your project and pm me the link, I could take a deeper look into it.

tobulos1

Quote from: Crimson Wizard on Wed 15/07/2015 10:00:01
This is very strange. "inventory" is a built-in global variable, it must be there, unless its a bug in AGS.
Can you tell, what would happen if you try using this variable somewhere in your script?

Maybe trying "Rebuild All files" may help?

Rebuilding all files didn't help, unfortunately :(

Quote from: abstauber on Wed 15/07/2015 10:43:16
@tobulus1: your version is alright, I just wondered why the inventory array causes trouble. The so called undefined symbol is an internal AGS variable which us just being used by the template. If you upload the sources of your project and pm me the link, I could take a deeper look into it.

Do you want me to send you the whole script (e.g. from Pastebin) or anything else?

Btw, forgot to say this: when I double-click the error, it takes me to guiscript.asc, and it highlights the following line:
Code: ags
if (player.ActiveInventory==inventory[key]) {


In context, this is the whole block of code:
Code: ags
text, text...

else if (UsedAction(eGA_UseInv) && key>=0) {
    if (any_click_move (x, y, dir)) {
      if (player.ActiveInventory==inventory[key]) {
        if (get_door_state(door_id)==1) { 
          if (!String.IsNullOrEmpty(get_door_strings("closefirst"))) player.Say(get_door_strings("closefirst"));
        }
        else if (get_door_state(door_id)==2) {
          if (unlockDoorSound != null) chan = unlockDoorSound.Play();
          if (!String.IsNullOrEmpty(get_door_strings("unlock"))) player.Say(get_door_strings("unlock"));
          set_door_state(door_id, closevalue);
        } 
        else if (get_door_state(door_id)==0) {
          object[obj].Visible=false;
          set_door_state(door_id, 2);
          if (!String.IsNullOrEmpty(get_door_strings("relock"))) player.Say(get_door_strings("relock"));
        }
      }
      else if (!String.IsNullOrEmpty(get_door_strings("wrongitem"))) player.Say(get_door_strings("wrongitem"));
    }
  }
  else result=0;
  
  return result;
  // 0 = unhandled
  // 1 = handled
  // 2 = NewRoom
}


Here's the whole GUI script (asc) and the GUI header (ash).

EDIT: Again, I have only copied the template scripts + GUI over to a fresh blank project. The only thing I have modified are the sprite IDs in the script, since I'm using my own at the moment.

abstauber

Hmm... I just did the same and it compiled fine. I started up AGS 3.3.2 and used the older template included to create a demo game.
Then I pasted your two script files over and it still works. So assume, something else must be wrong - the script files are fine as it looks.

If it's not too much to ask, maybe you could upload your complete project somewhere and provide me a download link via PM.

tobulos1

Quote from: abstauber on Thu 16/07/2015 20:35:19
Hmm... I just did the same and it compiled fine. I started up AGS 3.3.2 and used the older template included to create a demo game.
Then I pasted your two script files over and it still works. So assume, something else must be wrong - the script files are fine as it looks.

If it's not too much to ask, maybe you could upload your complete project somewhere and provide me a download link via PM.

Sent you a PM with my project. Thanks for looking into it!

SMF spam blocked by CleanTalk