EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
scriptproperties.html vs usage of this.ship.*
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
Browser_ice





Joined: 05 Feb 2006
Posts: 231 on topic

Thank you for registering your game
PostPosted: Sun, 1. Oct 17, 20:19    Post subject: scriptproperties.html vs usage of this.ship.* Reply with quote Print

Hi, I am having difficulties to find out in the scriptproperties.html which section covers usages of this.ship.commander & this.ship.knownname. I mean I cannot find which basic keyword has both them in its property list.

I thought maybe it is because this.ship was derived from an object, so I went looking at the properties of Object and both above properties are not in it.

Its neither ship.*, nor container.*, nor component.*

Is it because this.ship.commander and this.ship.knowname are considered two different objects/entities?

I was hoping that by finding to which basic keyword they refer to, I could then see what other properties I can use (this.ship.*).


_________________
Steam X-Superbox, playing XR
WIndows-7
Intel I5
16Gb Memory
Nvgidia GT 960
Back to top
View user's profile Send private message
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)

MEDAL

Joined: 20 Nov 2005
Posts: 13623 on topic

Thank you for registering your game
PostPosted: Mon, 2. Oct 17, 00:04    Post subject: Reply with quote Print

first clarify if you mean ai scripts or md scripts because the meaning of "this." is diffrent in both:
MD: the current cue
AI: the Entity which executes the Script

in the former case this.ship makes no sense and resolves to null with an error in the log i think.
in the latter case this.ship is the Ship on which the npc executing the script is currently on.

then next what knownname and commander means in aforementoined context:
.commander refers to the Superior Object, like the Station a Ship is assigned to.
.knownname results in the Name of the Ship, and always the real name regardless of wheter the player knows it or not (just .name can resullt in "Unknown Object" if the player currently doesnt know the real name)

i am also confused a bit by this question:
Quote:
Is it because this.ship.commander and this.ship.knowname are considered two different objects/entities?

because one of them results in another Object, and the other results in a text/string, which are both completely diffrent things...

also "this." itself is a base keyword, there is no other keyword where it acts as sub-keword.


and regarding the usage of the scriptproperties.html: it is not aware of * or other placeholders. if you want to see all sub-keywords of this.ship then just type this.ship.


_________________
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter Wink

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help Wink
Back to top
View user's profile Send private message
Browser_ice





Joined: 05 Feb 2006
Posts: 231 on topic

Thank you for registering your game
PostPosted: Mon, 2. Oct 17, 00:53    Post subject: Reply with quote Print

Thx for the reply.

I meant for AI scripts, related to ship actions.

if you take the AI script mining.ship.station.xml and look at the following code from it:

Code:
      <do_if value="this.ship.cargo.capacity" max="0">
        <debug_text text="'%1 has cargo capacity of %2!'.[this.ship.knownname, this.ship.cargo.capacity]" chance="$debugchance" />
        <set_value name="$failreason" exact="'ERR_NO_CARGOSPACE'" />
        <resume label="finish" />
      </do_if>
      <do_if value="not this.ship.commander.exists">
        <debug_text text="'%1 in %2: mining without commander not supported!'.[this.ship.knownname, this.ship.zone.knownname]" chance="$debugchance" />
        <set_value name="$failreason" exact="'ERR_NO_HOMEBASE'" />
        <resume label="finish" />
      </do_if>


you can see that this.ship.knownname, this.ship.cargo.capacity, this.ship.commander, this.ship.zone.knownname are 4 properties of the object/entity this.ship. Then I ad assume that these 4 this.ship.* are referencing the same object/entity.

Then why can't I find those 4 properties in the same property box in scriptproperties.html ?

Which property box contains properties knownname, cargo.*, commander and zone.*? Not in the ship, container or object's property listed box.

This is so I can understand what is the nature of the this.ship and therefore, finding out what other properties are available with it
.
I do not know all technical terms. So sorry for lengthy explanations.


_________________
Steam X-Superbox, playing XR
WIndows-7
Intel I5
16Gb Memory
Nvgidia GT 960
Back to top
View user's profile Send private message
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)

MEDAL

Joined: 20 Nov 2005
Posts: 13623 on topic

Thank you for registering your game
PostPosted: Mon, 2. Oct 17, 02:37    Post subject: Reply with quote Print

said properties are shared each with other stuff. if you want all properties of a certain variable type you can type it like $ship or $station at the top (just checked, but this.ship doesnt work for some reason, i guess because of the md-context for this which seems to have higer prio than the ai-specific stuff)


_________________
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter Wink

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help Wink
Back to top
View user's profile Send private message
w.evans





Joined: 18 Nov 2014
Posts: 2941 on topic

Thank you for registering your game
PostPosted: Mon, 2. Oct 17, 08:19    Post subject: Reply with quote Print

knownname is an attribute (or a property, i always confuse the two) of class component,
commander, of class controllable,
cargo, of container,
zone, of component

which you probably already know since you're working with scriptproperties.html. What isn't readily apparent in that document is which subclasses are derived from which classes.

In this case:
ship is a subclass of container,
which is a subclass of defensible,
which is a subclass of controllable,
which is a subclass of object,
which is a subclass of destructible,
which is a subclass of component.

So this.ship would have attributes of all of those classes.


_________________
MarineRebalance, BetterAutoAim, SmalltalkHack, Epic Capital Ship Shields, Miscellaneous IZ Combat Tweaks, Miscellaneous OOZ Combat Tweaks
Back to top
View user's profile Send private message
Browser_ice





Joined: 05 Feb 2006
Posts: 231 on topic

Thank you for registering your game
PostPosted: Mon, 2. Oct 17, 16:14    Post subject: Reply with quote Print

That is cool to be able to access all the properties of all the subclass the current object/entity/... is based on.

However, how can I find out easily for anyone, what subclasses it is based on without having to reverse engeneering through script codes ?


_________________
Steam X-Superbox, playing XR
WIndows-7
Intel I5
16Gb Memory
Nvgidia GT 960
Back to top
View user's profile Send private message
w.evans





Joined: 18 Nov 2014
Posts: 2941 on topic

Thank you for registering your game
PostPosted: Mon, 2. Oct 17, 16:24    Post subject: Reply with quote Print

i looked them up via scriptproperties.xml. for example:

<datatype name="ship" type="container">

<datatype name="container" type="defensible">

etc.

don't think there's an easy way to look them up in the html file.


_________________
MarineRebalance, BetterAutoAim, SmalltalkHack, Epic Capital Ship Shields, Miscellaneous IZ Combat Tweaks, Miscellaneous OOZ Combat Tweaks
Back to top
View user's profile Send private message
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)

MEDAL

Joined: 20 Nov 2005
Posts: 13623 on topic

Thank you for registering your game
PostPosted: Mon, 2. Oct 17, 16:58    Post subject: Reply with quote Print

UniTrader wrote:
...
if you want all properties of a certain variable type you can type it like $ship or $station at the top.
...


if it wasnt clear enough: the Expression Field at the top filters for what is currently available in your expression chain. and if you begin with a pseudo-var like $ship you can get all valid properties for a var which contains a ship (or a property which refers to a ship)

begin typing for example this:
$ship.zone.adjacentzones.count
anf look for each letter/property how the available expressions change.


_________________
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter Wink

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help Wink
Back to top
View user's profile Send private message
Xenon_Slayer
EGOSOFT
EGOSOFT



Joined: 09 Nov 2002
Posts: 10777 on topic
Location: Camping the North Gate of Black Hole Sun
Thank you for registering your game
PostPosted: Mon, 2. Oct 17, 17:01    Post subject: Reply with quote Print

If you type in the class in the search bar e.g. "$ship", it will show you the base class and the derived class on the left side. These are clickable but whether it takes you to those classes may depend on the browser.

And no, there is no full class breakdown view.

Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Control Panel
Login Data
The time now is Tue, 22. May 18, 16:05

All times are GMT + 2 Hours

[ Disclaimer / Impressum ] | [ Privacy Policy / Datenschutz ]

Board Security

Copyright © EGOSOFT 1989-2018
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.07867 seconds, sql queries = 23