[ian-reeds-games] Re: Version 2 of my scripts, capture that flag!

  • From: Ian Reed <support@xxxxxxxxxxxxxxxxxxx>
  • To: ian-reeds-games@xxxxxxxxxxxxx
  • Date: Sun, 15 Dec 2013 16:37:44 -0700

Hi Craig,

You can give working with items a shot and let me know if you hit issues.

The items list is stored here:
someUnit.Inventory.Items;

Here's some helpful properties that exist on an item object:
Quantity: number;
Useable: boolean;
Stackable: boolean;

Tiles also have an Inventory property, but it is not exposed to script in the current version.
I've just changed that so it will be available in the next version.

When adding an item to an inventory you should call:
someUnit.Inventory.AddItem(myItem);
This handles stacking the same item types together with a summed quantity.
It also removes the item from the old inventory if it was attached to one.
An Item keeps a reference to it's parent inventory which also gets updated through this method.

All undocumented, sorry, smile.

+1 for the mark down is awesome comments. That and TypeScript are my 2 favorite development related finds in the past 2 years.

Good luck!
Ian Reed



On 12/15/2013 4:11 PM, Craig Brett wrote:
Hi Victorious,

Thanks :-)  and I'll see if I can answer your questions.

Q1: Does units transforming into another still still make them lose their eq? A: I'm afraid so. I don't believe I have access to the unit's items in the scripts, so I can't move them across from the old unit to the new one. If that changes, I can fix that. Ian, if you're reading, can this be done?

Q2: I know that Alan has used the move other units scripts successfully on tile effects - will they still work on those now? The helpfile specified skills only. A: I set it to skills only, since I wasn't aware of this. SO how was that working? Was the effect on a tile and every time a unit walked onto that tile they were being push away or something? The script shouldn't have worked that way, but sounds like Allan at least had a use for it.

Q3: I saw a .md file in the documentation .zip, what does .md stand for?
A: .md files are markdown files. It's essentially a very light syntax that you put in an otherwise plain text file. When this is then processed by something that handles markdown, it makes a web page, such as the readme.html file that's in there. If you open up the .md file in notepad, you'll see it's almost plaintext with a few exceptions, particularly around anywhere where there's lots of underscores, since they're a special character in markdown. But most of it is just plain text. I can write HTML, but Markdown's quicker. It's really good for writing documentation. Ian uses them too for the game documentation, that's probably where you've seen them. It's pretty neat.

Craig

On 15/12/2013 16:17, Victorious wrote:
Hi Craig

Thanks for the updates and documentation - this looks awesome! Just a few
questions:

1. Does units transforming into another still still make them lose their eq? 2. I know that Alan has used the move other units scripts successfully on
tile effects - will they still work on those now? The helpfile specified
skills only.
3. I saw a .md file in the documentation .zip, what does .md stand for?
Always wondered as I see those files from time to time in TB.

Victorious

-----Original Message-----
From: ian-reeds-games-bounce@xxxxxxxxxxxxx
[mailto:ian-reeds-games-bounce@xxxxxxxxxxxxx] On Behalf Of Craig Brett
Sent: Sunday, December 15, 2013 10:45 PM
To: ian-reeds-games@xxxxxxxxxxxxx
Subject: [ian-reeds-games] Version 2 of my scripts, capture that flag!

Hi all,

Version 2 of my scripts are ready to go. It's largely a rewrite.

Warning: This contains breaking changes! The old syntax has been removed
and probably won't work anymore. I apologise for the inconvenience and
hope that the much better readability and ease of use makes up for it.

This new version of the scripts works on the script flags basis. As a
result, you will need to have converted your map packs to version 10 to
use them. You should anyway, it's a lot better!

Get the new version of the scripts here:
https://dl.dropboxusercontent.com/u/5405418/Craig%20Brett.zip
And the new documentation from here:
https://dl.dropboxusercontent.com/u/5405418/Craig%20Brett%20Documentation.zi
p

I still haven't figured out the keys or function type flags yet, so
there'll be a few more to come in version 2.1, hopefully soon.

If there is any weirdness or bugs, please let me know.

I hope you like the new stuff!

Craig






Other related posts: