Codemonkeys take heed! ;)

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Codemonkeys take heed! ;)

Post 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:
Riding the Rocket!
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

You're on a roll AH, keep taking the medicine! :wink:
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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>
Riding the Rocket!
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post 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
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

I wish I was a monkey....:(...then I could make wishes come true. ;)
Riding the Rocket!
dajt
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 364
Joined: Tue Aug 17, 2004 7:05 am
Location: Orange, NSW, Australia

Post 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>
Regards,
David Taylor.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

Why not?
there are multiple apllications!
Riding the Rocket!
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post 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.
dajt
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 364
Joined: Tue Aug 17, 2004 7:05 am
Location: Orange, NSW, Australia

Post 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.
Regards,
David Taylor.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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. :(
Riding the Rocket!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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:
Riding the Rocket!
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post 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...
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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?
Riding the Rocket!
Post Reply