Sharing a Template

Started by PPAentertainment, Fri 29/03/2024 06:01:42

Previous topic - Next topic

PPAentertainment

Hi friends:
I want to share with you a template I created using as a base the two click template that comes with AGS, a few lines of code from the old Xalarcost template and a few tweaks of my own.
I've been posting here twice about better user friendly templates and I thought I should give some, before asking.
It has several GUI's, few basic examples of interactions, a dialog example with changing colours for the lines, a status line that follows the mouse, the option to press space and show the hotspots on screen, a help or how to play GUI, credits, and changes can be done easily on the scripts to change a few things.
Take a loot at it, and let me know what you think.
Hopefully it will help somebody.
Here's the link: https://www.mediafire.com/file/27vddiozaft4q0z/PPATemplate.rar/file

Bye

lapsking

#1
Looks great. I had a look at it and also tried to have a loot at it. I was trying to steal the code for showing hotspots/objects with my astonishing coding knowledge and putting it in my own template, as I can't totally change into your template with half of the game done. I first saw this option in Simon the Sorcerer. I will be able to make as much as pixel hunting as I want.  But to be honest, I failed. Don't know what I'm missing but gives the error: GlobalScript.asc: undefined symbol 'GetViewportX'. I would appreciate if you help me to understand what's going on. Thank you PPA. Is it possible to have to this script in other templates like Tumbleweed too?
There is no cure for clumsiness, or at least I haven't found one.

Crimson Wizard

Quote from: lapsking on Fri 29/03/2024 07:57:25Don't know what I'm missing but gives the error: GlobalScript.asc: undefined symbol 'GetViewportX'.

GetViewportX is a deprecated function from before AGS 3.5.0. It may be brought back by selecting a lower "Script compatibility level" in General Settings, or by replacing this with Game.Camera.X in script.

More information about scripting API switches may be found here:
https://adventuregamestudio.github.io/ags-manual/ScriptAPIOverview.html#api-switches
We also have a table of replacements here:
https://adventuregamestudio.github.io/ags-manual/ObsoleteScriptAPI.html

lapsking

Okay, one thing I can suggest is that it seems it's compatible with AGS 2.1 which is very old, and I don't think much people use it these days. And It seems changing API to 2.1 messes with the whole 3.6 Version I'm using. I think I passed beyond the first error with Wizard's help but now it gives error: GlobalScript.asc: Error: Undefined token 'gHotspotDisplay' . And I couldn't find the replacement in the link provided, so maybe it doesn't contain all replacements for AGS 2.1. I'm a tad confused right now. But all I can suggest to PPA is to make his template for latest version of AGS. Otherwise I think it can be very useful.
There is no cure for clumsiness, or at least I haven't found one.

Crimson Wizard

#4
Quote from: lapsking on Fri 29/03/2024 08:51:31now it gives error: GlobalScript.asc: Error: Undefined token 'gHotspotDisplay' . And I couldn't find the replacement in the link provided, so maybe it doesn't contain all replacements for AGS 2.1.

It's probably AGS 3.2.1, not 2.1?

`gHotspotDisplay` sounds more like a GUI name (it's a tradition to name GUIs with `g` prefix), which means that the script expects a gui called `gHotspotDisplay` existing in your game. For the template it's important to contain all GUIs and other things. But if you copy a script from template, then you are responsible to also recreate all necessary game objects, or adjust the script accordingly.

lapsking

Quote from: Crimson Wizard on Fri 29/03/2024 09:40:29
Quote from: lapsking on Fri 29/03/2024 08:51:31now it gives error: GlobalScript.asc: Error: Undefined token 'gHotspotDisplay' . And I couldn't find the replacement in the link provided, so maybe it doesn't contain all replacements for AGS 2.1.

It's probably AGS 3.2.1, not 2.1?

`gHotspotDisplay` sounds more like a GUI name (it's a tradition to name GUIs with `g` prefix), which means that the script expects a gui called `gHotspotDisplay` existing in your game. For the template it's important to contain all GUIs and other things. But if you copy a script from template, then you are responsible to also recreate all necessary game objects, or adjust the script accordingly.
Yes, Yes, Sorry. AGS 3.2.1. AGS 2.1 even doesn't exist on compatibility list. I'll see what I can do. But I thought about adding this option to my game before. I don't see why for a small object or hotspot you shouldn't be able to make a small object or hotspot but at the same time it will cause pixel hunting which is annoying for the player. So I think this is a useful add on to template that PPA thought of it. I'll still see what I can do. Thanks for the hint about 'g' prefix.
There is no cure for clumsiness, or at least I haven't found one.

lapsking

@Crimson Wizard
Sorry for keep bothering for such a silly matter. I imported the GUI and all I had to do was to adjust the script and GUI to the game resolution. Now it's working for objects and characters but when I press the key for hotspots it gives this error:

"Did not find property 'hx' in the schema. Make sure you are using property's name, and not its description, when calling this command."

the code for hotspot is:
Code: ags
    
i = 0;
while (i<AGS_MAX_HOTSPOTS) {
int hx = hotspot[i].GetProperty("hx");
int hy = hotspot[i].GetProperty("hy");
if ((hx != 0) && (hy != 0) && (hotspot[i].Enabled)) {
DrawMarker(surface, hx, hy);
}
i++;
}
There is no cure for clumsiness, or at least I haven't found one.

PPAentertainment

Hi:
Lapsking, I suck too at coding. Like Crimson Wizard wrote, besides the code you should have in your game the game objects, in this case GUI, with the same name. When I took the original code from Xalarcost template I had to do the same. I created the template with AGS 3.6. but the compatibility I had to use it cos I didnt know what new code to use. Hope this is useful. Thanks for trying it.

PPAentertainment

Now I remember, you need to edit hotspots and add the hx schema. I can't check now because i'm not at Home and I'm using the phone. Later I will check. Sorry

lapsking

@PPAentertainment
Thanks. It will be great if you tell me how to do that. :-D
There is no cure for clumsiness, or at least I haven't found one.

lorenzo

I quickly tried the template, it's quite nice! I like the inclusion of the "show hotspot" button, since it's a feature that seems requested more and more these days.
Thank you for sharing your work, PPAentertainment!

lapsking

Quote from: PPAentertainment on Fri 29/03/2024 16:42:28Now I remember, you need to edit hotspots and add the hx schema. I can't check now because i'm not at Home and I'm using the phone. Later I will check. Sorry

I found schema in properties from manual.  Thanks for the template and your help. You upgraded me to newbie stage 2. (nod)  Hope I'll see more stuff from you.
There is no cure for clumsiness, or at least I haven't found one.

PPAentertainment

Lapsking
More than happy to be of help. And the real thanks should go to the guy who created the xalarcost template. I simply adapted from it. Most of my work on my games is trial and error and reading the manual and try to understand what to me was gibberish and still most is. I'm a 51 cuban guy with unending passion for adventures games but illiteracy on coding. I wanted to add effects with Inbetween module but I don't even know where to start.

lapsking

We suffer from same disorder, coding illiteracy. But your graphics have a style to them and a Cuban spirit which makes them unique and nonboring, keep that alive. I haven't played your game but will try it in free time. Sure your story is not a western copy/paste. It's your bonus.
There is no cure for clumsiness, or at least I haven't found one.

PPAentertainment

Thanks for your kind words Lapsking. Since you mentioned my last game let me do a bit of promoting. My games are Robotragedy1 and 2, Dr Lutz and the time travel machine, Maverick Gunn and the Eye of OggĂșn, The manuscrito of Sarmanyanha, Postcard Adventure and the very little Outlaws Gold. I developed a Hidden object game too but only un spanish. Unfortunately I still have a few started projects that Will never see the light because right now I can't spend those many hours painting and My limited skills are spent. Maybe in 40 years, when I'll be in My nineties I'll be able to pay some good artists to finish them... jajajaja!!!

lapsking

Quote from: PPAentertainment on Fri 29/03/2024 21:26:48Thanks for your kind words Lapsking. Since you mentioned my last game let me do a bit of promoting. My games are Robotragedy1 and 2, Dr Lutz and the time travel machine, Maverick Gunn and the Eye of OggĂșn, The manuscrito of Sarmanyanha, Postcard Adventure and the very little Outlaws Gold. I developed a Hidden object game too but only un spanish. Unfortunately I still have a few started projects that Will never see the light because right now I can't spend those many hours painting and My limited skills are spent. Maybe in 40 years, when I'll be in My nineties I'll be able to pay some good artists to finish them... jajajaja!!!

Wow, you have a very very long CV, I didn't mention your last game though. Good for you. I'm currently working on my first and last game. You are lucky to live up to 90, I doubt I'll reach 75.
There is no cure for clumsiness, or at least I haven't found one.

SMF spam blocked by CleanTalk