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

Topics - HeirOfNorton

#1
Couple questions regarding the plugin interface. It gives instructions for overriding the built-in functions, but can this be used to override the member functions of AGS classes? They would have to be declared, I assume, like:

Code: ags

int MyChar_AddInventory(AGSCharacter *cha, InventoryItem *item, int addAtIndex);

RegisterScriptFunction("Character::AddInventory^2", MyChar_AddInventory);


But would that actually work?

If so, how would we declare the objects passed as the first parameter? Are the AGSCharacter and AGSObject classes the right ones for those cases, or are they different? What about the other objects that are not exposed in the plugin header?

I'm working on a plugin that would require the (very careful) replacement of some very basic functions. If I have to, I'll make do with separate functions and just tell the user to use mine instead of the regular ones, but it would make things much easier for other folks using it if I could just ... alter the original functions themselves. Very carefully.

HoN
#2
Advanced Technical Forum / Talking frame?
Sat 02/09/2006 00:37:33
Hey folks, got a question. I know how to get the current frame of regular characters. Is there a way to get the current SPEAKING frame of a character when using Sierra-style speech?

HoN
#3
Hey folks, just a little helper if anyone wants it. It occurred to me that most of the functionality needed for a vector (or a dynamic array, if you prefer) already existed in AGS in the form of the new String class, so I whipped this here up.

This is a vector class for integers. At this time it does not work with any other data type. I have not included separate documentation, but the module header is fully commented with usage and the API.

I'm not really sure how useful this will be. I mainly did it as coding practice, but I figured it could be useful to anyone who really needs a dynamic array, at least until CJ gets around to implementing the real thing.

You can download it HERE.

HoN
#4
This occurred to me as a useful addition, and I haven't seen it in the tracker. Basically specifying a sub-rectangle of the sprite to be drawn, rather than having to draw the whole thing.

At the moment, this can be done with:
Code: ags

//not quite true code ahead
DynamicSprite.CreateFromExistingSprite
DynamicSprite.Crop
RawDrawImage


but this can get a little tedious if it is something done very often, or with several different parts of the original sprite.

On top of that, if RawDrawImage is just a wrapper for Allegro's blit function then this should be pretty easy to implement, and will run quite a bit faster than the above code.

HoN
#5
Seeing all the modules SSH has been releasing made me feel like I was slacking, so...

I present the Icon Based Dialog System script module!!

This module (well, modules, really) allows you to easily add a complete icon-based dialog system to your game, similar to the one used in Discworld and... other... games, I think.
Anyway, all you have to do is create your GUI. Make it look however you like, just be sure to add some buttons to it. Then import the IconDialog modules, and use the functions to hook into your GUI and buttons.

Some of the neato features:
* Simple API that'll get you speaking in pictures in no time!
* Highly customizable, and easily (I hope) extensible.
* The ability to automatically reposition the icons, and
  resize the GUI match. (Or not, whichver you like!)
* No practical limit on the number of dialog topics and
  options, each with its own icon associated with it.
* The ability to run dialogs as usual, or jump straight
  to a specific option.
* Cross-platform compatible

Download here (Requires AGS 2.71!)
Mirror

Edit: And here is a short demo game showing how to use it:

Get the demo

HoN

Edit: P.S. I do, of course, welcome any bug reports or suggestions for additional features.

* Side note, isn't it amazing how quickly you come to depend on new features without noticing it? While I was writing this, I thought it would be compatible with plain AGS 2.7, as I didn't use any of the new String or DynamicSprite stuff. Then I looked through the code, and the lists of updates, and realized that a fair amount of the code depends on lazy eval, introduced in 2.71 beta 5. And I can't even claim that I'm just used to C++, cause I'm not. When I'm coding in C++ I have to remember that I'm NOT coding in AGS, not the other way around.  ;D
#6
...on a scripting language.
To wit, I am in the very early stages of writing a program to simplify Dialog-tree writing. Something like ca0mgr's editor, but with more functionality, and more generic. I plan to use XML files as the main save/load format, but with Import/Export scripting for other file formats. That way, for example, a user could import an AGS .dlg file, edit it in the program, and export it as an XML file, as a .dlg, or as plain-text code ready to use with the Scrolling-Dialog module.

My question is this: does anyone have any suggestions on which would be the best scripting language for this purpose? I'm looking for something that can manipulate variables fairly robustly, and can interface with C++ without too much difficulty. I'm equally ignorant of Lua, Ruby, Perl, Python, etc, that none of them would be any more difficult to learn for me than any other, but do you have any opinions also on which would be easier to use for AGS coders (or WME or AGAST; I said it's going to be generic)? Finally, do you know which would be the easiest to embed/use in my program code?

Any opinions/help on this greatly appreciated.

HoN
#7
Hey folks, I've got yet another script module for your consumption.  Are any of you making a game using the File I/O functions, perhaps for a player-generated character, or some other use? Were you perhaps worried that some unscrupulous player could hack the file and change the character's stats on a whim? Or perhaps you are using text files for some of the game's content, but don't want players to be able to change what's been written? Well, worry no more!  ;D

Ahem, anyway, this module adds an EncryptedFile class that is intended to be a drop-in replacement for the standard File objects already used. It uses a simple (but nearly impossible to break) Exclusive-Or encryption to secure your external files, so no one can read them but you. It also includes a small EXE for encrypting plain text/binary files so they can be read by the program (source code included).

Download here (Requires AGS v2.71!) (Thanks Neole!)
Mirror 1 (Thanks Colxfile!)
Mirror 2 (Thanks Candle!)

Please note that this is still a beta version (I'd love to hear about any bugs/issues/suggestions for the sucker), and that it requires AGS 2.71 or higher.

I hope you find it useful.
HoN
#8
Advanced Technical Forum / AGS3D +PLUS+ beta
Fri 09/09/2005 06:56:25
Well, here's what I have so far. It's far from perfect, but it does what it's supposed to do (mostly).

They say a picture is worth a thousand words, so...





Those really are screenshots from AGS. Honest.

This is a modified version of Steve Mcrea's Ags3d script module. The major additions are:

++ New Wall primitive (a flat polygon)
++ Texture mapped walls and primitives
++ The ability to modify those textures with scale and offset, etc.
++ Sky box and sky texture (check out the moon in the town square)
++ Sector-based culling and optimization*.

* What this means is, you designate sectors in the 3d world, and the primitives will only be drawn if they are in the same sector as the player. This won't help with outdoor scenes like the town square, but for complex indoor scenes (halls and rooms) it can really speed things up. (Want to see the difference? Turn it OFF in the new example room and watch the frames per second disappear.)

I did not add a HUD or weapon to the script module. I did, however, add a weapon in the new demo room using a dummy character, and hopefully it shouldn't be too hard to figure out how to do it yourself.

This is still a beta version. Several bugs and errors still in it, and the code could use cleaned up and comments, but here it is to see what you can do. This zip file only contains the source files, not a compiled version, so you will need to compile it (ctrl-s) with AGS 2.71beta5 or higher.

Download it here. Thanks to www.americangirlscouts.com for the file hosting.

Whatcha think?
#9
After seeing strazer's success at converting plugins to script modules, I decided to try my hand at it as well, so here's my version of a Finite State Machine for AGS v2.7, inspired by the FSM plugin by Frederico Jeronimo.

This module allows you to create Finite State Machines, useful for keeping track of complex game states and for simulating character AI.

Features:
* Create more complex AI separated from implementation
* Unlimited number of FSMs or States
* Save FSM maps in external files, making them easier to change
* cross-platform compatibility
* extensible and customizable

Note that this is not a direct 1-to-1 conversion like strazer's, but a slightly different take on the same idea. If anyone would be interested in a full-blown replacement for the plugin (one that would allow you to remove the plugin and insert the script module without changing your existing code) please reply to this thread and I'll write it as an add-on.

Download here

The zip file includes the script module, documentation, an executable compiler (for those external files I mentioned), and c++ source for same.

There you go, hope you can use it,

HoN
#10
Advanced Technical Forum / Array size limit?
Mon 06/06/2005 02:02:08
Okay, I've tried searching through the archive but I haven't been to find an answer on this.
Is there currently a limit on the size of an array, either in the highest index or in total bytes? I'm currently working on a script module that will make use of some fair sized arrays, and will allow game authors to increase the size of thoses arrays if necesarry. I'm quite sure that the current limits (if any) are still more than enough, but I'd like to know for sure so I can include some error checking.

HoN
#11
Hey, I've just started playing around with VB6 (I'm thinking of making a more useful dialog editor than what is included with AGS, we'll see) and I've come across on odd problem...
I just followed the example from the COM plugin tutorial. Basically copy and paste. The first part, just getting it initialized worked fine. When I added the code to add in a menu option, it still worked fine upon loading the Plugin, but when I DISABLED the plugin in the manager, I got this error message:

Quote
A serious error occured while communicating with plugin 'AGS_Testy.ocx' in method 'EditorShutdown'. Please ensure you have the correct plugin version for this AGS version.

It still unloaded fine, otherwise. Here's the odd part. While just trying different things, I commented out the code that goes in DisablePlugin that removes the menu option. Lo and behold, it now works fine, and even removes the option upon unloading the plugin even without specifically coding it to do so.

This happens in both AGS 2.62 and the current beta.

So, is the example wrong, and editor.Menu(0).RemoveMenuOption does NOT need to be called, or is something weird going on?

HoN

P.S. Do you have any plans of expanding the COM Plugin docs, either with more details on the available methods/members, or with a tutorial on setting one up in C++? (Not that it makes THAT big a difference, as I'm using Dev-C++ and can't really make any COM plugins with it anyway, just wondering.)
Quote
#12
Hey folks. As my "teach yourself C++" project I'm working on a simple program to convert the exported .DLG files to something a little easier to manipulate and back again.. I'm leaning toward an XML file, currently, as there are several free- and shareware programs to edit XML files in a tree view. But I have a couple of questions...

First, for CJ:
When importing .DLG files, is it necesarry to have the compiled code included as well as the plain text source code, or will it still import successfully with only the text source? If the compiled code is necesarry, is there any way you could make the compiler available to me for the program? (I'd be satisfied with a binary I can call from my program, if you want to keep your source code private).

Also, what exactly ARE the entryPoints and topicFlags? I thought I knew what the entryPoints were, but when I read them from a .DLG file they didn't turn out that way, and all the topicFlags come out as nulls.

For everyone else:
For the XML files, would you prefer to have have the Option numbers/topic numbers/stuff like as entities (eg: <topic>1 <option><number>1</number> <text> Hi there!</text></option></topics>) or as attributes (eg: <topic number=1> <option number=1>Hi there! </option> </topic>? I prefer the latter, but I can go either way at this point, and I want it to be the easiest to work with for everyone.
Alternatively, if anyone doesn't like XML  :o, what file formats would you suggest?

HoN
#13
Hey folks, I was just wondering, is there any particular reason for the limits imposed by AGS (eg. 15000 sprites, 500 dialog topics)? I can understand how the number of sprites/objects/rooms/etc. could become resource hogs if they grew too high, but what about the number of dialog topics/options. Those numbers seem kinda arbitrary.

Bear in mind, however, that I know incredibly little about programming. So, is there any particular reason these limits are set to where they are, and not higher (or unlimited)?

The main reason I ask is that I'm working on a game with a fairly complex dialog system, in which the options and responses change depending on the NPCs' attitudes toward the player. More dialog topics/options might make this easier, though I'll probably end up doing a lot of it using RunScript anyway.

Thanks,
HoN
SMF spam blocked by CleanTalk