Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - strazer

#481
There is the Character.InventoryQuantity property you can use to check if a character has a specific inventory item:

Code: ags

  if (cGeorge.InventoryQuantity[iBall.ID] > 0) {
    Display("George has the ball.");
  }


If you tell us what you want to do exactly, we might be able to help you further.
#482
Yes, that's my understanding. Apparently his Easy3D module uses custom character properties.
#483
Ah, you mean the built-in custom properties accessible from the editor? Sounds like a good idea to me. What do the others think?
#484
Since your first problem isn't limited to the AGS help file, I'm moving this to the General discussion forum to help you get more replies that will hopefully help fix your system.

Please post another thread in the Tech forum about your second problem.
#485
Aside from the warning messages you get, can someone explain to me why dynamic sprites have to be deleted at all when the game is quit? Won't they automatically be freed from memory when the AGS engine shuts down?
#486
1.) Since AGS's help system is HTML-based, it has probably something to do with your Internet Explorer. But I don't know what to suggest. Does IE itself work okay?
#487
Isn't that the game.talkanim_speed global variable?

  Manual -> Reference -> Scripting global variables
#489
I've noticed that the length of our discussions and the documents themselves seems to have made people reluctant to release their modules in fear of violating these guidelines.

And I agree the perceived amount of rules seems quite high at first. That's why I've written a short, easy-to-read summary of the guidelines that will hopefully encourage more people to release their modules.

NOTE: This is a summary, you can find the full discussion and detailed documents here.


SCRIPT MODULE GUIDELINES


Please note that we agreed on these guidelines to bring all modules in line and to ensure that they work smoothly together. You are encouraged to follow them, but these are merely suggestions and we'd rather you publish your module as-is than not at all.
If you just want to make sure that your module doesn't interfere with others, pay special attention to the suggestions in bold.


PROGRAMMING CONVENTIONS

Module
- Unique name: Check this Tech Archive and the AGS Wiki
- Name at least 3 characters long (for auto-completion), as short but as descriptive as possible
- Name in camel notation: MyModule

Definitions/Macros
- Name in uppercase: #define MYMACRO 500
- If in module header, prefix module name: #define MyModule_MYMACRO 500

Variables
- If declared in function (dynamic): Lowercase name
- If declared in module script (static): Camel notation name
- If declared in module script & imported into header (global): Module prefix & camel notation name
Code: ags

// module script

int MyModule_MyVariable; // global
export MyModule_MyVariable; // global

int MyVariable; // static

function do_stuff() {
  int my_variable; // dynamic
}

Code: ags

// module header

import int MyModule_MyVariable; // global


Functions
- If only used in module script: Camel notation name
- If imported into script header (global): Module prefix + camel notation name
- Grouping of functions by using static member functions is recommended:
Code: ags

// module header

struct MyModule { // IMPORTANT: The bracket needs to be placed directly after the struct name
  import static function MyStaticFunc();
  //...more functions here
};

Code: ags

// module script

static function MyModule::MyStaticFunc() {
  // do stuff
}

Code: ags

  // some script

  MyModule.MyStaticFunc();
  // typing "MyModule." will pop up all available functions


GUIs *3
- GUI name: Uppercase module name+number: MYMODULE1 (Truncate module name if necessary)
- GUI control name: Prefix name of its GUI: MYMODULE1_Jump

Enums
- Enum name in camel notation, prefixed with ModuleName
- Value names in camel notation, prefixed with e+ModuleName *4
Code: ags

enum MyModule_MyEnum {
  eMyModule_Value1,
  eMyModule_Value2,
  eMyModule_ValueN
};


Structs
- If defined in module script: Lowercase name
Code: ags

// module script

struct mystruct {
  int MyInt;
  char MyChar;   
  short MyShort;
  float MyFloat;    
  String MyString; // AGS v2.71+
};

- If defined in module header: ModuleName + camel notation name
Code: ags

// module header

struct MyModule_MyStruct {
  int MyInt;
  char MyChar;   
  short MyShort;
  float MyFloat;    
  String MyString; // AGS v2.71+
};

- For instances of structs the variable name rules apply
- Struct members:
Code: ags

// module header

struct MyModule {

  // Public member variables
  int MyVar;
  writeprotected int MyReadOnlyVar;

  // Public member functions
  import function MyFunc();

  // Public static member functions
  import static function MyStaticFunc();
       
  // Private member variables (only accessible by other members)
  protected int my_var;

  // Private member functions (only accessible by other members)
  import protected function my_func();
}


Module version info
- Put definitions in module header for dependent modules to check for:
Code: ags

// module header

#define MyModule_VERSION 200 // current version
#define MyModule_VERSION_200 // provides v2.00 functionality
#define MyModule_VERSION_100 // provides v1.00 functionality



DOCUMENTATION

- Plain text or html file for maximum compatibility
- Same name as module
- Should contain:
  - Module name
  - Module version
  - Authors
  - Description of what module does and what it can be used for
  - Dependencies on other modules / plugins / AGS versions
  - List of all public functions and variables and how/where they are used
  - Revision history / Changelog with date
  - License: Free for non-commercial AND commercial use? Credit required or optional?
    We suggest the MIT license:
Quote
/ Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.


PUBLISHING

- Download should include at least the .scm module file & documentation
- A demo game is optional
- Zip format preferred for maximum compatibility
- Post the announcement thread in the main Technical Forum
- Thread subject line: "MODULE: MyModule v1.00 - Optional short description"
- State which version of AGS it was written for
- Moderators will move the thread to the Technical Archive at the appropriate time
- Finally, add your module to the list of script modules in the AGS Wiki



*3 This is my idea, I don't think we reached a consensus yet? What do you think?
*4 e moved to front to avoid value names popping up when typing the module name



Changes:
- btnJump -> Jump
- Added note about placing bracket direclty after struct name
- Fixed full discussion link (Thanks SSH)
- Removed reference to post below
- Added link to Candle's upload space
- Removed link to Candle's upload space
- Fixed AGS Wiki links
- Removed link to Neole's upload space
- Updated code sections
#490
I don't think that will be a problem as long as you do it with the editor closed.
#491
Quote from: InCreator on Sat 22/04/2006 15:09:56But it's quite weird that in puzzles where you have continously move from room to room, music is always reset to track start.

It shouldn't. Once you have started a music track, it should loop continuously until you stop it.
But if you start it again in the enter event of each room with
  PlayMusic(1);
the music track will play from the beginning.
Do this instead:
  if (GetCurrentMusic != 1) PlayMusic(1);

You could also use the built-in "Play music on room load" textbox in the Room settings pane. I think it won't restart the track, but I'm not sure?

You're basically asking for the PlayMusic function to automatically not restart the track if it's the same track that's already playing, right?

Edit:

Okay, seems I have misunderstood you. Sorry.
#492
This is for Windows 2000:

- Open Windows Explorer (not Internet Explorer)
- Menu "Extras" -> "Folder Options..."
- Tab "File Types"
(- If there is already a file type named "AGSGAME", delete it)
- "New" button
- Extension: Type "AGSGAME" -> "OK"
- Select AGSGAME entry
- "Advanced" button
- "New.." button
- Action: Type "Open"
- Application used to perform action: "Browse..." for your agsedit.exe
- Append -shelllaunch "%1", i.e.
  "c:\path\to\ags\agsedit.exe" -shelllaunch "%1"
  Note the three l's in shelllaunch
- "OK", "OK", "Close" etc.

Now you can double-click the "Edit this .AGSGame" file to open your games.
#493
Btw, the Digraphs module is here: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=23779

People (I'm talking to you, SSH! ;)), please try to link to the stuff you talk about.
#494
What speech font are you using?

Since there is a limited amount of characters in an SCI font (no accented characters, for example), the creator of the font probably replaced little-used special characters in the font with accented ones.
So if you wanted to have the character display saying "Café", you would have to script it as "Caf<".

I'm afraid there's no other solution than to avoid using these characters or use another font.
You also can import TrueType fonts, they support more characters, including accented ones.
#495
I don't use Windows (Linux user) so I can't check at the moment, but you have to associate it with "Edit this .AGSGame" (.AGSGame) files, not ac2game.dta (.DTA) files.
#496
Quote from: subspark on Fri 21/04/2006 14:18:45
Quote from: strazer on Fri 21/04/2006 13:31:02Why is the filesize of a mask important? It is only used at design-time, it doesn't affect the compiled game at all.
It's not. But the error message when you import a mask the same resolution as your background eg. 320x150 is inconvenient and unessicary.

True, I'm sure that's doable.

Quote from: subspark on Fri 21/04/2006 14:18:45
Quote from: strazer on Fri 21/04/2006 13:31:02As to why alpha-blended walkbehinds are a problem, the this thread.
Read it already. Many have said that you need two images for an alpha blended mask. First the color pass then an alpha.
You really only need one image; like the one I provided above. It essentially IS the alpha only that the colors determine exactly what channel each walkbehind is assigned to.

I have to admit I don't completely understand the problem, but Steve seemed pretty adamant about it. Maybe someone else can weigh in.

Quote from: subspark on Fri 21/04/2006 14:18:45Isn't this the whole idea of being part of the developer community to share ideas particularly those that future proof AGS for more complex games like ours? Please don't get me wrong in a certain light I agree with you Strazer but is it not worth testing and ultimately adding to CJ's to do list?
It's not the tool thats worth worrying about it's the principle and how often it will be applied.

It's a matter of opinion. I think there a more important things for CJ to work on, but ultimately it's up to him to decide. So let's see what he has to say when he comes back (whenever, from wherever... :P).
#497
You may have noticed that AGS stores the last few games you edited, so once you have opened a game from somewhere else via "Load an existing game", it gets added to the "Load a recently edited game" list. So no need to browse through folders all the time.

Also, you can associate the "Edit this .AGSGame" file with the AGS Editor so when you double-click it, the game gets opened with the editor:

Quote from: Pumaman on Mon 10/05/2004 21:54:42
Quote from: strazer on Mon 10/05/2004 01:18:58Btw, I've always wondered what the "Edit this .AGSGame" file is for?

In the version of AGS that was distributed as a windows installer, it created an association for ".AGSGame" files so that you could double-click the "Edit this AGSGame" file to open the game in the editor.

You can create this association manually if you like, just set up .AGSGame files so that their association is:

c:\path\to\ags\agsedit.exe -shelllaunch "%1"
#498
Scorpiorus, I added that link to his post. Isn't that what you referred to, SSH?
#499
I think the Templates subfolder is enough.
I have my games in separate directories somewhere else, so I don't care about a Projects sub-folder.
#500
Quote from: subspark on Fri 21/04/2006 11:52:36* Ability to import 24bit Bitmap into mask editor

Yeah, even if not all colors are used 24bit format should be supported, if it's not alreasy. If you're talking about aplha-blending, see below.

Quote from: subspark on Fri 21/04/2006 11:52:36* Colors are picked up and automatically assigned baselines and induvidual channels.

I think that would be too much work for too little gain. How often do you have that many walkbehinds anyway? And in most cases the baselines would probably need tweaking anyway, so you can just as well put them there in the first place.

Quote from: subspark on Fri 21/04/2006 11:52:36For some reason masks currently need to have a vertical resolution identical to the game resolution.
For games with the LucasArts GUI or any GUI for that matter the room graphics may not extend to the bottom of the screen.

Why is the filesize of a mask important? It is only used at design-time, it doesn't affect the compiled game at all.

Quote from: subspark on Fri 21/04/2006 11:52:36* Mask is premultiplied so that the black is transparent with no black halo or artifacts.

As to why alpha-blended walkbehinds are a problem, the this thread.
SMF spam blocked by CleanTalk