Author Topic: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)  (Read 17242 times)  Share 

abstauber

  • Order of the Maggot
  • Mittens Vassal
  • quite remarkable
  • abstauber worked on a game that was nominated for an AGS Award!abstauber worked on a game that won an AGS Award!
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #140 on: 01 Jul 2011, 07:42 »
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]
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...
[/code]

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]   
    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"); 
[/code]

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]
import int lang;
[/code]

This is the new game_start function.
[code]
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;
}
[/code]

That should do the trick.
« Last Edit: 01 Jul 2011, 07:44 by abstaubE3 »

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #141 on: 01 Jul 2011, 12:19 »
@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.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #142 on: 05 Jul 2011, 15:05 »
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

  • Believe it or not...
    • I can help with voice acting
    •  
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #143 on: 27 Oct 2011, 08:09 »
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

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #144 on: 27 Oct 2011, 09:31 »
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.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

abstauber

  • Order of the Maggot
  • Mittens Vassal
  • quite remarkable
  • abstauber worked on a game that was nominated for an AGS Award!abstauber worked on a game that won an AGS Award!
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #145 on: 27 Oct 2011, 09:45 »
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

  • Believe it or not...
    • I can help with voice acting
    •  
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #146 on: 28 Oct 2011, 01:07 »
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]function room_FirstLoad()
{
set_door_state(1, 0);
init_object(1, oVoodooDoor.ID);
}[/code]

and

[code]function hVoodooDoor_AnyClick()
{
  if (any_click_on_door (1, oVoodooDoor.ID, 470, 182, eDir_Right, 2, 456, 186, eDir_Right)==0) Unhandled ();
}[/code]


abstauber

  • Order of the Maggot
  • Mittens Vassal
  • quite remarkable
  • abstauber worked on a game that was nominated for an AGS Award!abstauber worked on a game that won an AGS Award!
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #147 on: 28 Oct 2011, 12:37 »
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

  • Believe it or not...
    • I can help with voice acting
    •  
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #148 on: 28 Oct 2011, 14:35 »
My character walks right up to the point in the code then he just stops, and nothing else happens.

abstauber

  • Order of the Maggot
  • Mittens Vassal
  • quite remarkable
  • abstauber worked on a game that was nominated for an AGS Award!abstauber worked on a game that won an AGS Award!
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #149 on: 30 Oct 2011, 13:20 »
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

  • Believe it or not...
    • I can help with voice acting
    •  
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #150 on: 30 Oct 2011, 20:14 »
I would LOVE to upload it, it's just that I don't know how.  :-[

straydogstrut

  • Barking up the wrong tree
    • I can help with play testing
    •  
    • I can help with proof reading
    •  
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #151 on: 30 Oct 2011, 20:56 »
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

  • Believe it or not...
    • I can help with voice acting
    •  
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #152 on: 31 Oct 2011, 00:50 »
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.
« Last Edit: 31 Oct 2011, 01:20 by DrakeStoel »

abstauber

  • Order of the Maggot
  • Mittens Vassal
  • quite remarkable
  • abstauber worked on a game that was nominated for an AGS Award!abstauber worked on a game that won an AGS Award!
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #153 on: 31 Oct 2011, 07:32 »
Found the error, for some reason, the GoTo command in your guiscript is broken.

guiscript.asc, line 702:
[code]
    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);
[/code]
has to be
[code]
    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);
[/code]

DrakeStoel

  • Believe it or not...
    • I can help with voice acting
    •  
Re: TEMPLATE: 9-verb MI-style 1.3 UPDATE (15th Feb 2011)
« Reply #154 on: 31 Oct 2011, 14:11 »
Yup. That did it. Thanks a bunch.  ;D