First project: a simple MI template

Started by SmashManiac, Sun 11/01/2004 04:49:49

Previous topic - Next topic

SmashManiac

After trying Proskrito's MI2 template, I found it to be ridiculously difficult to use compared to the original AGS, so I've done one myself! There's no pause, load, save or "Are you sure you want to win?" screen, but who needs them anyway when there are already those from AGS?

Based on the demo game, several changes has been made to be more accurate to LucasArts' games - and without bugs! So simple, you'd be surprised! Place your own sprites (or keep current ones) and have fun!!!

Features:
- VerbBox GUI similar to MI or DotT!
- Partially compatible with the AGS Interaction Editor
- Right click for default action:
 - Create a default custom command for every object
 - Returns to walk mode in any other mode
 - Default action highlighted when over an object!
- Can make classic 320x200 VGA or 800x600 SVGA games!!! (Just change the GUI X-Position and Y-Position)
- Almost no stored variables:
 - 1 string (Action)
 - 1 integer (VerbBox)
 - 1 integer property per object (DVerbBox)
- Not any part of script needed to copy-paste everywhere!
- IsAction function added: one is enough!!!
- Simple to use and understand for any AGS user!

All details in the script header:
http://membres.lycos.fr/will373/VerbBox%20v.1.0.agt

Tell me what you think of it. Would you use it and why? Any suggestions to make it better?

Proskrito

#1
Great template! i´ve tried it and it's good, but i dont see why my template is 'ridiculously difficult to use' (oh that hurted! ;))compared to yours. yous surely have less code, but i think that doesnt mean necessarily 'less difficult'. (please, dont think im here to say 'people, use mine not smashmaniac's!' , i can see people preferring yours to mine :) ), i´ve downloaded it to see if there were simpler approaches to things, and i would have asked you if i could use them in my templates, but i didnt.
I mean, point by point:
-VerbBox GUI similar to MI or DotT!
well, both have them :)
-Partially compatible with the AGS Interaction Editor
i dont know very well what it means
-Right click for default action
Yours have it with a numeric custom property, mine have it attaching >x , being x a character. I did it that way because in that time custom properties werent implemented in AGS so i had to make a properties system, but later i didnt change them because i find the >x thingie faster to see and edit (you dont have to access custom properties, and i find also easier to remember a character that a number)
-Returns to walk mode in any other mode
If its what i think, both have it.
-Default action highlighted when over an object!
Both : )
-Can make classic 320x200 VGA or 800x600 SVGA games!!!
Both
-Almost no stored variables
Is it a feature?i mean, some of those are for the system, other are for customizing some things. The fisrt ones you wont have to touch them, and the second ones you could want to change them, in order to customize the interface.
-Not any part of script needed to copy-paste everywhere!
I dont know what it means...
-IsAction function added: one is enough!!!
That 'IsAction' function is exactly the same as my 'UsedMode' one. And one could be enough, but more can be useful : ) (and nobody forces you to use the others : P)
-Simple to use and understand for any AGS user!
Well, mine could not be simple to understand (sometimes i get lost too ;) )but i think its easy to use and customize.
My point is, sure yours is more 'simple', but thats because i added some features.
(Apart from the menus, map rooms, cancelable movements and other movement functions that you could not need)...
What about the unhandled event?
What if you want to use any other mode? (like 'sail to' or 'spit to' in mi2)
Can actions be assigned to the 'Walk to' mode as in MI2?
Would it be easy to translate?
Does it behaves pretty much like MI2? (strange things with the default command and the inventory)
What about variable default actions? (like a door)
Have also in mind that my template is a SCUMM template with MI2 theme, not a MI2 template, so its aimed to be able to recreate interfaces also from maniac mansion 1, indy 3...
I mean, if you use in my template only the features that are in yours, they are the same difficult. (just replace (IsAction with UsedMode, and write >x in the name instead of going to c.properties), so i dont know. I wont force anyone to use all the functions in the template ;).
But i agree that its not as easy as a default sierra interface AGS game, so if you can simplify the features that a scumm interface must have, i will definetly (sp?) use your template!  :)

EDIT: btw, i think the function 'IsAction' is imported in the script header as 'ActionIs' (or vice-versa), you might want to change it : )

SmashManiac

Lol! You were the last person that I expected to receive a comment... but you're probably also the best person to do one for me!

Ok, maybe not "ridiculously difficult to understand"... let's say "not intuitive"... or "holy cow what all that code means I'm just a newbie" ... or... whatever. No offence, I'm a newb with AGS.

"- Partially compatible with the AGS Interaction Editor
i dont know very well what it means"
Only that it's not always obligatory to create a script. I'll erase that line.  ;)

"- Not any part of script needed to copy-paste everywhere!
I dont know what it means..."
There's no need to use Windows' clipboard to put a part of script in it and paste it in every new object, item or character. Saves time.

You were right for the ActionIs import... so if you want to try it now everyone go to the script header and change it to IsAction... or wait 24h so I can upload v.1.1!

Thanks to your comment, I've corrected the IsAction import and now DVerbBox is a string, so more simple to use for v.1.1!

Here's your answers:

Q. What about the unhandled event?
A. No unhandled event for now. I don't really like using it so I didn't think about it, but I will add it in v.1.1.

Q. What if you want to use any other mode? (like 'sail to' or 'spit to' in mi2)
A. It's not implemented, but it is easy to create an "if" in the repeatedly_execute that overlaps a part of the code and maybe disable GUI buttons and move the inventory out of the screen in those conditions. It shouldn't be too hard to also do some kind of video like the fight in Marley's mansion in MI1.

Q. Can actions be assigned to the 'Walk to' mode as in MI2?
A. Yes. Select "Any click on", create a script and write "if (IsAction("Walk"==1) {...}".

Q. Would it be easy to translate?
A. Since the dialog system is the same one as the implemented in AGS, there shouldn't be any problem. The sprites on the GUI aren't too. Finally, for the status bar, there's only the words written at the beginning of the main code (currently line 27 to 56) to change to whatever you want, or add more complexity to it. (In other words: I didn't put a translate function, but not that important)

Q. Does it behaves pretty much like MI2? (strange things with the default command and the inventory)
A. No cancel thing when an action is executed with a click. The use of the word "with" when an item is selected. "Use key with". In MI2, sometimes it would be something like "Use key on". Otherwise, I don't think so. (2 points for you! Am I not a good guy?  ;D)

Q. What about variable default actions? (like a door)
A. That the point of the DVerbBox property. However, the number representation was not a good idea, and I wanted to correct it but forgot. Putting it in the inventory name was too weird for me!  ;) Also an advantage was to be able to change that property in the script (when you open a door, change DVerbBox to "Close" instead)

However, I agree with: "Have also in mind that my template is a SCUMM template with MI2 theme, not a MI2 template, so its aimed to be able to recreate interfaces also from maniac mansion 1, indy 3..." I didn't want to to create a MI2 theme, just an interface like MI. (In that case everyone get Proskrito's template.  ;)) It's not hard to add more buttons and new actions, but it's not easy to find out every place you need to change, so there's something to change here too. I'll try something...

I DO think your template is more powerful than mine, but it's also meant for experimenced users (unlike me). Your code is so coded that it's very hard to understand anything that's written (oh yeah that's at the beginning of the page, oops that's not an AGS function, etc.). I'll try to make mine simpler each day.

Thanks for your help! Since I've been typing that for an hour I'll get a small break and work on 1.1 later!  :)

SmashManiac

Well, I've tried something and it worked...

... so version 1.1 is already there!!!
http://membres.lycos.fr/will373/VerbBox%20v.1.1.agt

I've listened to Proskrito's suggestions and now it's now easy to customize it to do a "spit" action, change GUI buttons, or translate it.

Major changes are that I've put all my things in functions so it's more easy to understand and change the code, and I've totally removed numeric values for actions.

There's still no unhandled_event thingy, but I've discovered it's very easy to create one if desired: just start the unhandled_event function manually (or maybe not in some cases) and add lines like:
"if ((IsAction("Pick up")==1) Display("Yeah, right.");"

Room 1 is just a plain walkable area for debug purpose.

Maybe in my spare time I'll do an example with it...

Proskrito

Quote"- Not any part of script needed to copy-paste everywhere!
I dont know what it means..."
There's no need to use Windows' clipboard to put a part of script in it and paste it in every new object, item or character. Saves time.
Does any AGS game need that? ;)
QuoteQ. Can actions be assigned to the 'Walk to' mode as in MI2?
A. Yes. Select "Any click on", create a script and write "if (IsAction("Walk"==1) {...}".
It doesnt work to me :-\
QuoteQ. Would it be easy to translate?
A. Since the dialog system is the same one as the implemented in AGS, there shouldn't be any problem. The sprites on the GUI aren't too. Finally, for the status bar, there's only the words written at the beginning of the main code (currently line 27 to 56) to change to whatever you want, or add more complexity to it. (In other words: I didn't put a translate function, but not that important)
Well, it could be important if you wanna translate your game to several languages, think that you are trying to simplify the game making! : )
QuoteQ. What about variable default actions? (like a door)
A. That the point of the DVerbBox property. However, the number representation was not a good idea, and I wanted to correct it but forgot. Putting it in the inventory name was too weird for me! Also an advantage was to be able to change that property in the script (when you open a door, change DVerbBox to "Close" instead)
But, you cant change the custom properties, so you cant do that, i think...
QuoteYour code is so coded that it's very hard to understand anything that's written
The thing is that if you are new to AGS, you dont have to understand it, just read the documentation ; ). (or better, start with the default ags interface until you feel more confident)

yeah, the new version is better!  :D
QuoteOk, maybe not "ridiculously difficult to understand"... let's say "not intuitive"... or "holy cow what all that code means I'm just a newbie" ... or... whatever. No offence, I'm a newb with AGS.
I see what you mean, but just imagine that all these lines starting with /**/ doesnt exist, like if they were built in AGS... the code you could want to modify is very small, and thats because all those functions : )
QuoteI've listened to Proskrito's suggestions and now it's now easy to customize it to do a "spit" action, change GUI buttons, or translate it.
good! :) but be careful, your code is growing ;)
QuoteMajor changes are that I've put all my things in functions so it's more easy to understand and change the code, and I've totally removed numeric values for actions.
(oh no, more functions! :P) yeah, much better with names instead of numbers.
About the unhandled event, its not difficult to make one, doing what you said, and making it so you can check what kind of location the player clicked on, and that should be enough. : )

SmashManiac

Quote from: Proskrito on Mon 12/01/2004 10:35:13
QuoteQ. Can actions be assigned to the 'Walk to' mode as in MI2?
A. Yes. Select "Any click on", create a script and write "if (IsAction("Walk"==1) {...}".
It doesnt work to me :-\

That's odd... I've tried it and it works. (at least in v.1.1)
Here's what I've done: I've tried to go interaction editor on the key item, create a "run script" event in the other click section and wrote "if (IsAction("Walk"==1) Display("It's already in my pocket!");", and a normal click worked on it. (walk to key-already-in-inventory, hehe) However, since the key background is transparent, the click does a pixel-perfect detection.

Proskrito

mmm... 3 things:
1- You cant 'walk to' inventory items in MI2 (or any lucas game)(it switch automatically to 'look at' in MI2 and FOA and to 'use' in DOTT, just if you want to implemet that :) )
2- Even if you could, you probably wouldnt want to, it makes no sense, does it? ;)
3- Try it in a hotspot/object/character (where you would want to use it), and for me, it just walks there. I think its because 'any click' isnt triggered by mode walk.

SmashManiac

Quote from: Proskrito on Mon 12/01/2004 18:47:21
mmm... 3 things:
1- You cant 'walk to' inventory items in MI2 (or any lucas game)(it switch automatically to 'look at' in MI2 and FOA and to 'use' in DOTT, just if you want to implemet that :) )
2- Even if you could, you probably wouldnt want to, it makes no sense, does it? ;)
3- Try it in a hotspot/object/character (where you would want to use it), and for me, it just walks there. I think its because 'any click' isnt triggered by mode walk.

...you're right. Geee, you're smart.

...
...
...
...
Ok, the "Any click on" doesn't work. However, you can always use regions for that. For example, if we were doing a gap at the middle of the screen and do a "Walk to" at the other side, the caracter will go all the way to the pit and stop there. If we use a 1-pixel region at the border, we would be able to stop him with a message. I don't see any other use of a "walk to" overlap. I'll try to change that again the simplest way possible.

And for the "walk on item" thing to remove...
...
...
...
...
argh...
...
...
...guess I'll have to improve my code again.  :-[

magintz

very nice, tis :)

I've already taken a look at it, and might be using it, with all due credits :D
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

SmashManiac

Sorry, I didn't work on my project here for a while...

...look, I've just started school, and I must learn 4 programming languages in 3 months: PHP / mySQL, C, Java and Visual Basic. Add AGS to that, geez...

Soooo... I'll try to work on it for tomorrow.

SmashManiac

Sorry folks, just when I taught I had finished I discovered a bug from v.1.1: RIGHT-CLICKING ON AN ITEM DOESN'T START ITS DEFAULT INTERACTION!!!

Sooo... it will probably take another day to finish.

SmashManiac

Finally done! I think it's totally bug-free now:
http://membres.lycos.fr/will373/VerbBox%20v.1.2.agt

...whew!  8)

Major change: inventory clicks are now handled in script. (5k larger, nooooo!) but now items won't do silly things! I've used the "Day of the Tentacle" parameters by default for actions... still easy to change!

Finally, I don't think I'll do a default room. It's already too much job just to write the code!

SMF spam blocked by CleanTalk