Page 1 of 2

Codemonkeys take heed! ;)

Posted: Thu Mar 01, 2007 11:25 pm
by Arexack_Heretic
What is missing are some basic methods that give more handles on game parameters. Some would be really usefull for possible equipment and weapon_oxps.

generic mission scripting:
>GetPlayerInfo: key >>returns the value stored under the requested key.
To help in defining mission requirements.
such as playerMaxCargo to determine the cargohold of the playership

>Can locations gathered from getCoordinatesFromTarget be used as parameters in locational methods such as addAhipInRadius?
If so: cool! we need to document that in the wiki.
If not: I want it to,
maybe a method to store those coords as callable values.
example:
addShipsAtPrecisely <Coordsystem> <X> <Y> <Z> <shipentity> <number>

---

Equipment scripting:
Options to modify weapon behaviour, besides damage and colour. and more freedom to think up nice equipment.

awardCargospace: negative for big (not cargohold increasing) refits
awardPylon (for extra pylon, should cost cargospace)

<key>cycle rate
<key>range
<key>allowedMountings <array>
<key>requires: <conditions script>


energydrain (and energyDrainTarget)
addHeat (and addHeatToTarget)

fireItemFromMissilePort (item can function as non-pylon missile)
ammonitiontype: (MISSIONPARAMETER) AMMO_TYPE1_25
expendAmmo: -1, negatively increments AMMO_TYPE1_25 to .._24

etcetera...

Not being unthankfull, just throwing out suggestions. :)
by the shedload. :roll:

Posted: Fri Mar 02, 2007 1:33 am
by TGHC
You're on a roll AH, keep taking the medicine! :wink:

Posted: Fri Mar 02, 2007 2:12 pm
by Arexack_Heretic
Oh important one:

Key binding
Probably needs to be hardcoded and defined in a plist.

eg. in equipment.plist or such::
<key>Boundkey</key>
<integer>keyvalue</integer>
<key>PlusShift</key>
</false>
<key>PlusCTRL</key>
</false>

with:
<key>key_action</key>
<array>
<string>performScriptOnTarget: becomeExplosion</string>
</array>

Posted: Sat Mar 03, 2007 7:51 am
by Commander McLane
YES, :twisted: that's what I want! :twisted: All of it! :twisted: NOW! :twisted:

Arexack, you're the man!

:D :D :D :D :D

Posted: Sat Mar 03, 2007 9:49 am
by Arexack_Heretic
I wish I was a monkey....:(...then I could make wishes come true. ;)

Posted: Sun Mar 04, 2007 11:36 pm
by dajt
I actually implemented scripts bound to keys last year, but couldn't find a use for it so never checked it in!
Arexack_Heretic wrote:
Oh important one:

Key binding
Probably needs to be hardcoded and defined in a plist.

eg. in equipment.plist or such::
<key>Boundkey</key>
<integer>keyvalue</integer>
<key>PlusShift</key>
</false>
<key>PlusCTRL</key>
</false>

with:
<key>key_action</key>
<array>
<string>performScriptOnTarget: becomeExplosion</string>
</array>

Posted: Sun Mar 04, 2007 11:40 pm
by Arexack_Heretic
Why not?
there are multiple apllications!

Posted: Mon Mar 05, 2007 12:59 pm
by Commander McLane
I second that very much!

I'm sure there are lots and lots of ideas out there for new equipments, but many of them would need a key in order to be used (e.g. retrorockets, see https://bb.oolite.space/viewtopic.php?t=3053). Or imagine a keystroke for "sendDistressCall" (after all NPC-AIs can react to distress calls). Some programmers have helped themselves with having their new equipment items take one missile-slot, but that's not a general solution.

Posted: Mon Mar 05, 2007 11:51 pm
by dajt
Well, the JavaScript branch allows OXPs to listen for keystrokes to trigger behaviour so it is covered there.

My original thought last year was that binding scripts to keys would allow OXPs to create new equipment too, but in the standard game engine there isn't enough of the internals exposed to do anything very useful.

Neither of the things you mention as examples are possible just by allowing a script to be triggered by a keystroke. They need changes to the engine.

Posted: Tue Mar 06, 2007 12:02 am
by Arexack_Heretic
yup, I figured that.

That's why I was cooing at the monkeys...
they know lots about bananas (and code), they can write shakespeare given time and an infinite universe. Beware of calling the librarian monkey!

hmm... code-Oorangatangs?

er...damn going mental with scripting again. :(

Posted: Tue Mar 06, 2007 12:27 am
by JensAyton

Posted: Mon Mar 12, 2007 10:57 am
by Arexack_Heretic
Another request, that is rather a bug-fix than a new method:

Fixing the ScanForNonThargoid/scanForThargoid methods, so that all ships with role = "thargoid*" ("thargoid, missile", thargoid(0.20), "bug, thargoid", etc) are recognised as "thargoid".

Or was this already fixed...I can't remember. :oops:

Posted: Mon Mar 12, 2007 12:35 pm
by Commander McLane
dajt wrote:
Well, the JavaScript branch allows OXPs to listen for keystrokes to trigger behaviour so it is covered there.

My original thought last year was that binding scripts to keys would allow OXPs to create new equipment too, but in the standard game engine there isn't enough of the internals exposed to do anything very useful.

Neither of the things you mention as examples are possible just by allowing a script to be triggered by a keystroke. They need changes to the engine.
Of course they do. It wouldn't help to have the scripts listen for keys, as that would happen only once every ten seconds. Not very useful for an immediate action...

Posted: Mon Mar 12, 2007 1:38 pm
by JensAyton
Arexack_Heretic wrote:
Fixing the ScanForNonThargoid/scanForThargoid methods, so that all ships with role = "thargoid*" ("thargoid, missile", thargoid(0.20), "bug, thargoid", etc) are recognised as "thargoid".
This is not fixed, and there is at least one other related issue. The underlying problem looks relatively simple, but testing and finding all variants of the problem will take time. It’s on my list now.

Posted: Mon Mar 12, 2007 2:50 pm
by Arexack_Heretic
what variants are you talking about here?

Do you mean all methods and code checking the 'role' of entities, when it should be checking the 'roles' for presence of a single role?

AFAIK:

Code: Select all

ScanForRandomMerchantmen- looks for roles player and trader.
ScanForNearestMerchantmen 

ScanForNonThargoid-only ignores ships with 'thargoid' in role.
scanForThargoid -selects random thargoid in range

scanRole - random select
scanForNearestShipWithRole -select closest

scanForLoot
scanForRandomLoot 
scanForRocks
but methods like AddShips: <role> could be affected too?