Page 2 of 3

Re: AT Scripting Language documentation

Posted: Thu Nov 21, 2013 6:58 am
by Zukero
PK17 wrote: Also Zuk, as I was reading through this for the third or fourth time, I notice you said you couldn't think of any reasons to use the map.onENTER trigger for anything besides the map.

I always thought it would be cool if say you entered feygard territory and all (or some) feygard items recieved a boost, same for the blackwater items if you are in/near blackwater, and all (some) other faction related locations. Also, let's say in map 'elytharashrine5' there is a shrine that when upon entering the map it automaticly removes any kazual or shadow items equiped then forbids you from equipping them.
Thanks for being so brave PK17 ! Reading this three or four times, you must be an expert now !

Actually, in your examples, I think it should still be the map that have the map.onEnter script. If it is an effect specific to 'elytharashrine5', it should not be part of the items definition. To be more clear, here's how I would do it (some functions do not exist yet) :
map 'elytharashrine5' has property 'scripts' with value 'remove_kaz_shad_items;prevent_kaz_shad_equip'
then, in a scripts definition file :

Code: Select all

"remove_kaz_shad_items" map.onEnter [
player.unequip("kazaul_item_1");
player.unequip("kazaul_item_2");
player.unequip("shadow_item_1");
player.unequip("shadow_item_2");
][Unequips all items imbued with the spirit of Kazaul or the Shadow]

"prevent_kaz_shad_equip" item.onEquip [
if (item.id == "kazaul_item_1") {
  cancelAction();
} else if (item.id == "kazau_item_2") {
  cancelAction();
}<...>
][Prevents equiping all items imbued with the spirit of Kazaul or the Shadow]
Or, you could make the "remove_kaz_shad_items" script give an actor condition to the player that lasts forever (removed when you exit, with another script), that itself prevents equiping the kaz_shad items (so the player can see what happens).
Or, you could also use a player.statsUpdated script that will nullify the effects of the equiped items.

Many possibilities with slightly different effects, but still no need to attach a map.onEnter script to anything else than a map.

One potential effect of attaching a map.onEnter script to a weapon for example, is that when this weapon is equipped, you gain 1HP each time you enter a new map... doesn't make sense to me, as the only game object who can have a notion of whether the map limits are indeed limits in the game world are the maps themselves ! Then again, it would still work, so if someone, someday, comes up with a good idea using this, it would work !

Re: AT Scripting Language documentation

Posted: Thu Nov 28, 2013 5:21 am
by Pyrizzle
I have a plan in the work for 2 temples to be built.

1) A temple of Light
~Elyr and other "Light" items would receive a boost
~ROLS: Shadow Regeneration will not work while within the temple walls

2) A temple of Shadow
~ROLS and other "Shadow" items would receive a boost
~ELYR: Would loose it's bonus 2 AP effect while within the Temple walls

I have also been working on a few ideas for more "Light" and "Dark" items that would be effected by the temples... I might even work on a quest concept I've had where you can have an item "blessed" by one of the Temples for a non-permanent boost to one of your "Light" or "Dark" items.

So many concepts floating around in this noggin... Time to put some more onto paper and eventually onto the forums for some feedback.

Re: AT Scripting Language documentation

Posted: Thu Nov 28, 2013 6:51 am
by Covenant
1. Is it possible to put complex expressions directly within the while/if statements condition? Or does the condition need to be pre-calculated in separate code (before the if statement and before/within the while loop) and the result assigned to a local variable? The local variable (only) then being used as the if/while condition. I assume yes, since it's all C syntax style anyway. - never mind, examples have demonstrated this. I assume that basically any valid code syntax from javascript/c style programming here is valid, the limitations being the data types, operators and available objects?

2. Any handling for floating point values? If not storable in local variables, what is your recommendation for handling the results of calculations that are not while numbers? I've assumed that the definition of "numeric" actually means unsigned integer (although that doesn't seem right). - never mind, I kept reading and had it answered.

3. Can we use the short circuit operators || and && in conditions and scripts?objects? - again, I've been typing my questions before finishing reading and have an answer for this already, sorry.

4. I Agree with not having operator precedence. More so because I like the idea of forcing lazy programmers to use parenthesis for precedence - which makes for much easier reading of code anyway.

5. Love your work. Simple, logical, elegant.

Re: AT Scripting Language documentation

Posted: Thu Nov 28, 2013 9:45 am
by Zukero
@Pyrizzle : I had an idea close to this. In a temple (of shadow ?), a priest allows you to prove your faith, and then be introduced to the local "god" thingy, so you're left alone in a room (actually a "dream"), and a "voice" asks you which path you seek : power, wisdom, or peace. Then, depending on the path, you are faced with a different ordeal. For power, you have to battle fierce monsters, for wisdom, you have to solve a riddle/puzzle/whatever using brains in a limited time (no potions can give you HP, and life is drained by an actor condition), and for peace, you have to survive a battle where your AC & AD are set to zero (opponent has an actor condition draining life from it). If you win, you receive a reward depending on the path chosen, if not (death), you are simply awaken from your dream, not loosing anything. --But that's more suited for another topic.

@Covenant : thanks for #5. Hope it'll end up having a quality as high as my hopes on it :D
Covenant wrote:I assume that basically any valid code syntax from javascript/c style programming here is valid, the limitations being the data types, operators and available objects?
Yeah, we could more or less say that. The key word being "expression", whatever evaluates to a boolean can be used in a if or while condition. However, there is no static type checking, so if you try to do while (9+5) {...} , the compiler won't complain but the script will crash when run, potentially crashing the game itself (depending on the thread calling the engine for this script instance).

Re: AT Scripting Language documentation

Posted: Thu Nov 28, 2013 10:04 am
by Covenant
Zukero wrote:However, there is no static type checking, so if you try to do while (9+5) {...} , the compiler won't complain but the script will crash when run, potentially crashing the game itself (depending on the thread calling the engine for this script instance).
So to achieve the same effect as a high level language, I'd have to represent the expression more explicitly with a logical or comparison operator such as the below?

Code: Select all


if ( (9+5) > 0 ) {
    //do some script stuff here
}
else if ( (9+5) == 14 ) {
    //do some script stuff here
}

(note I'm using parenthesis appropriately) :D

Re: AT Scripting Language documentation

Posted: Thu Nov 28, 2013 10:18 am
by Zukero
Exactly !
(note that I'm using the exclamation mark appropriately too :lol:)

Re: AT Scripting Language documentation

Posted: Fri Nov 29, 2013 1:36 am
by cccd3cpt
Love how this is growing so quickly, Zukero!

It'll make programming the game very simple. It's kinda like a library, yes? For robotics in C, libraries make everything 1000% easier and faster to do.

Lol, it makes life easy for everyone except the one actually writing the script; amazing work as always!
Maybe you could move the documentation to github as a wiki page?

Re: AT Scripting Language documentation

Posted: Sun Dec 01, 2013 3:37 pm
by Zukero
New updates with many new features : new triggers item.onEquip & item.onUnequip. Many new fields accessible on actor & player.

@cccd3cpt : it's not really like a library. A library is written in the same language as the project, and is meant to be used by the same language, simply providing higher-level, reusable functions. This is called a DSL : Domain Specific Language. A custom language made to express in the most simple & direct way ideas specific to a topic, in this case, andor's trail game engine.

Moving this documentation to a wiki page is on the plan, but only after this is merged in the main game code, and there are at least two features that I want to implement before :
- attack related triggers (attack.onTry, attack.onHit, attack.onMiss, actor.onKilled, actor.onHitReceived)
- all skills feature (reimplment the whole skill system using scripts)

Re: AT Scripting Language documentation

Posted: Mon Dec 02, 2013 2:52 am
by cccd3cpt
Ummm. Thanks for clearing it up :)

Look forward to seeing the wiki when the merge comes along then :D

Re: AT Scripting Language documentation

Posted: Sun Dec 08, 2013 4:15 pm
by Sarumar
Pyrizzle wrote:I have a plan in the work for 2 temples to be built.

1) A temple of Light
~Elyr and other "Light" items would receive a boost
~ROLS: Shadow Regeneration will not work while within the temple walls

2) A temple of Shadow
~ROLS and other "Shadow" items would receive a boost
~ELYR: Would loose it's bonus 2 AP effect while within the Temple walls

I have also been working on a few ideas for more "Light" and "Dark" items that would be effected by the temples... I might even work on a quest concept I've had where you can have an item "blessed" by one of the Temples for a non-permanent boost to one of your "Light" or "Dark" items.

So many concepts floating around in this noggin... Time to put some more onto paper and eventually onto the forums for some feedback.
+1 Nice ideas Pyro!