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

#140
Oh, there's really a bug in OptionsDefault_OnClick, but applies if you use AGS 3.1.

@Khris: Wouldn't simply setting those min and max values in the GUI editor do the same thing? Of course for Jack it's a good start to corner his bug. But I don't exactly get why this could be a bug.

@Jack regarding updating to 1.3
Damn, I should have written an upgrade plan :D

For updating there are quite a few steps to do, so unless you know what you're doing I'd say to rather stick to 1.2.1 for a while. But if you want to get your game translated to lots of different languages, maybe an update isn't such a bad idea after all.

Anyway here's the plan:

First copy this variable block to a safe location so it doesn't get overwritten.
Code: ags

int
ActionLabelColorNormal          = 15219,  // colour used in action bar
ActionLabelColorHighlighted     = 38555,  // highlighted colour used in action bar
invUparrowONsprite              = 124,    // sprite slot of the upper inv arrow / normal
invUparrowOFFsprite             = 154,    // sprite slot of the upper inv arrow / disabled
invUparrowHIsprite              = 137,    // sprite slot of the upper inv arrow / highlighted
....and so on...


Then you need to find the code block were you define your button sprites. Unfortunately I can't give you line numbers since I don't archive the old versions

Code: ags
    
    SetActionButtons(eGA_GiveTo, "a_button_give    0  125  138 Qq");
    SetActionButtons(eGA_PickUp, "a_button_pick_up 1  126  139 Ww");
    SetActionButtons(eGA_Use,    "a_button_use     2  127  140 Ee");
    SetActionButtons(eGA_Open,   "a_button_open    3  129  142 Aa");
    SetActionButtons(eGA_LookAt, "a_button_look_at 4  134  147 Ss");
    SetActionButtons(eGA_Push,   "a_button_push    5  131  144 Dd");
    SetActionButtons(eGA_Close,  "a_button_close   6  133  146 Zz");
    SetActionButtons(eGA_TalkTo, "a_button_talk_to 7  130  143 Xx");
    SetActionButtons(eGA_Pull,   "a_button_pull    8  135  148 Cc");  


If you did any more edits to guiscript.ash (like different unhandled event responses), you should save those too.

Now you can copy and paste guiscript.asc and .ash from the newer template and after that you can simply set the values back to your old ones thanks to your backup ;)


Globalscript:

In the global script, you have to add this block to the other imports at the top of the script
Code: ags

import int lang;


This is the new game_start function.
Code: ags

function game_start() {

  String tr_lang;
  // --- translate GUI action buttons ---
  tr_lang = GetTranslation("GUI_LANGUAGE");
  tr_lang = tr_lang.LowerCase();
  
  if (tr_lang == "de") {
    lang = eLangDE;
  }
  else if (tr_lang =="es") {
    lang = eLangES;
  }
  else if (tr_lang =="fr") {
    lang = eLangFR;
  }  
  else if (tr_lang =="en") {
    lang = eLangEN;
  }
  else if (tr_lang =="it") {
    lang = eLangIT;
  }   
  AdjustLanguage();   
  
  // --- Set default Door strings (Look, locked and wrong item)
  set_door_strings("The door looks solid.","It is locked.","I can't unlock it with that.","I have to close it first.","Now it's unlocked.","The door is locked again.");
  // --- initialize game settings ---
  SetDefaultAction(eMA_WalkTo);    
  set_double_click_speed(GetGameSpeed()/4);
  
  // --- set the pixel gap for listbox items according to the screen res
  if (System.ScreenWidth<640) listBoxGap = 2; 
  else listBoxGap = 4;
} 


That should do the trick.

Khris

@abstauber:
You're right, I'm not sure how the pre-3.2 slider and 3.2 code ended up in the same game, but it's looks like a user error.

Jackpumpkinhead

Sorry for the delay on the reply
The "bug" is fixed
Turns out you guys were right the min and max values for the slider weren't set right

@abstauber: thanks for the update plan. I'll probably use it once everything is finished
currently on an indefinite hold.

DrakeStoel

I'm having a weird problem with the door script. I put in my code, the door opens and closes fine, but I can't use it. It's very strange

Khris

What do you mean, 'use' it? As in click the Use verb, then the door? You're aren't really supposed to do that; use a region to switch rooms instead.

abstauber

Quote from: LeKhris on Thu 27/10/2011 09:31:22
use a region to switch rooms instead.
The doorscript also handles the room change. To enter it, you need to click (walk to) on the hotspot and wait until the player gets there.
Remember, the opened door is the object and has to be unclickable, which you set up with init_object.

Or by "use" did you mean the verb button?

DrakeStoel

I've done all that. And by use I just mean my character won't go through to the next room. Here's the codes I'm using.
Code: ags
function room_FirstLoad()
{
set_door_state(1, 0);
init_object(1, oVoodooDoor.ID);
}


and

Code: ags
function hVoodooDoor_AnyClick()
{
  if (any_click_on_door (1, oVoodooDoor.ID, 470, 182, eDir_Right, 2, 456, 186, eDir_Right)==0) Unhandled ();
}



abstauber

Hmm.. I just tried your code and it works fine for me. Does anything happen after you click on the opened door? Does the character at least move towards it?


DrakeStoel

My character walks right up to the point in the code then he just stops, and nothing else happens.

abstauber

Well you could upload your game somewhere for me to look at.
Currently it doesn't seem like it's a bug in the template.


DrakeStoel

I would LOVE to upload it, it's just that I don't know how.  :-[

straydogstrut

If you don't have your own webspace, i've seen quite a few people using Mediafire or somesuch to host their files. Personally I find it a bit unprofessional for hosting final games but for quick Q&A things like this it's probably a good idea.

Instead you could try Dropbox. There's a vid on the website that explains how it works but basically it gives you a folder on your computer that you can chuck stuff into and it will be available on all your other computers, and on the Dropbox website.

Once Dropbox is installed, zip up your game and chuck it in the Public folder, then just right click on it and 'copy public link' which you can paste in this thread or a PM to abstauber.

Hope that helps :)

DrakeStoel

#152
Thanks straydogstrut. That helps a lot!  ;D As for the file, here it is:

EDIT

The first link didn't work. HERE is the proper one:

http://dl.dropbox.com/u/47552660/My%20Game.zip

Sorry, it's kinda big.

abstauber

Found the error, for some reason, the GoTo command in your guiscript is broken.

guiscript.asc, line 702:
Code: ags

    if (blocking==0) player.Walk(xtogo, ytogo);
    else if (blocking==0) {
      player.Walk(xtogo, ytogo, eBlock);
      arrived=0;
    }
    else if (blocking==0) arrived=MovePlayer(xtogo, ytogo);

has to be
Code: ags

    if (blocking==0) player.Walk(xtogo, ytogo);
    else if (blocking==1) {
      player.Walk(xtogo, ytogo, eBlock);
      arrived=1;
    }
    else if (blocking==2) arrived=MovePlayer(xtogo, ytogo);


DrakeStoel


abstauber

Since we're getting a new release of AGS, I wonder I could drop the support for the old audio system. Currently the script checks for #ifver 3.2 and I suppose that breaks for 3.3 anyway.

I hope you're okay with that decision.

Crimson Wizard

Quote from: abstauber on Wed 29/05/2013 10:42:36
Since we're getting a new release of AGS, I wonder I could drop the support for the old audio system. Currently the script checks for #ifver 3.2 and I suppose that breaks for 3.3 anyway.

As an option you may check "#ifdef STRICT_AUDIO"

Crimson Wizard

Are the download links still valid? I am not able to connect to http://shatten.sonores.de, at all.

My intention was to check the latest version of the template and see if it has same problem as the one shipped with AGS 3.2.1:
The "Quit" button on the Options gui sais "QuitätÖ" when using English translation (I have a feeling I reported this back in 2011).

Other than that, are you still planning on removing old-style Audio support? In my previous response I suggested using "#ifdef STRICT_AUDIO", but that's not a fully proper solution, because in AGS >=3.2 users may mix audio styles, e.g. turn backwards compatible mode to only use old-style functions in particular cases. Perhaps a new macro may be introduced, like "#define USE_OLD_AUDIO", which may only be enabled if STRICT_AUDIO is on:
Code: ags

#ifdef STRICT_AUDIO
#define USE_OLD_AUDIO // comment this line if you want this template essential functions use only new style audio
#endif

abstauber

#158
Aw, it's down again? I seriously need to find a different provider. Almost every sunday it crashes with no cron-jobs involved...grr.
Quote from: Crimson Wizard on Mon 01/07/2013 13:50:25
The "Quit" button on the Options gui sais "QuitätÖ" when using English translation (I have a feeling I reported this back in 2011).
Hehe, that was a test to see if the font supports int. characters. There are also two more bugfixes in the most recent version, but I haven't uploaded it yet.

Quote from: Crimson Wizard on Mon 01/07/2013 13:50:25
Other than that, are you still planning on removing old-style Audio support?
Well, I'll try to define a constant with a few ifver lines to keep the old-style audio in.

edit:
Here's the new one. I've just learned that ifver 3.2 means "3.2 and above", so it would have worked all the time. Still I've added the constant USE_OBJECT_ORIENTED_AUDIO, so code is a bit easier to read.
http://shatten.sonores.de/wp-content/uploads/2013/07/9verb_131.zip

Crimson Wizard

I never paid attention to this before, but there's a Walk Behind mask in the first room, looking like a rope bridge shape.

SMF spam blocked by CleanTalk