 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
Nicoman35
Joined: 17 Nov 2005
Location: Bochum
|
Posted: Mon, 21. May 12, 08:22 Post subject: MD Skript issue |
|
|
Hi folks, my question refers to the skript The Marauder: http://forum.egosoft.com/viewtopic.php?t=223132
I have an issue regarding its md skript inside of the director folder. It searches the universe for the station called TheMarauder. When it finds one, it creates an actor inside of it.
As long as there are no other marauder shipyards in the universe, everything works fine. A Marauder shipyard is created somewhere in a pirate sector and the actor pops up inside of it.
Now, I play the game with many other mods such as XRM, Phanon corp, Brennans Triumph Tortuga and many more. Anyhow, the universe contains at least another marauder.
The md skript is not searching for the new created one, but picks the first one it finds!! So there is a chance the wrong shipyard is chosen for the actor.
Problem: I need to tell the md script which shipyard is the right one. I somehow have to pass the sector name and coordinates of the right shipyard to the script. How to do this???
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Argonaught.

Joined: 06 Nov 2002 Posts: 1575 on topic Location: Omnipotence rules!

|
Posted: Mon, 21. May 12, 08:57 Post subject: |
|
|
That mod is a mix of scripts and one MD file.
The scripts seem to be responsible for spawning and maintaining the shipyard and maybe other stuff...unfortunately i can't tell you how to edit those.
The MD file is only used to find a Marauder shipyard and insert the actor into it that offers the missions.
If I knew more about scripting i could help but alas
but It'll be a scripter that could help you there.
Argo.
_________________ [MOD]X3TC No Fog / [MOD]X3AP No Fog / [MD]X3TC Menagerie Shipyard / [MD]X3AP Menagerie Shipyard
<==<<Argonaught>>==>
XBTF>XT>X2TT>X3R>X3TC>X3AP
I lurk alot for the most part now
 |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Nicoman35
Joined: 17 Nov 2005
Location: Bochum
 |
Posted: Mon, 21. May 12, 12:11 Post subject: |
|
|
| Argonaught. wrote: |
....
If I knew more about scripting i could help but alas
but It'll be a scripter that could help you there.
Argo. |
Nice of you to reply.
Yes, its exactly as you say. The scripts in the script folder are responsible for spawning, maintenance, surveliance, moving and respawning the marauder.
The one in the director folder controls the boron mechanic mission.
Unfortunately, I don't know how to tell the damn programm to choose the right marauder.
...I could insert some code to destroy every marauder shipyard in the universe, saving the coordinates in a variable, then let the script create the intended one. After creating the actor then restore all marauders back in place.
But I don't know if this has any impact on the other mods. I would rather take a more elegant way.
Last edited by Nicoman35 on Mon, 21. May 12, 12:37; edited 1 time in total |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Ketraar


Joined: 21 May 2004 Posts: 7258 on topic Location: Guimarães (Portugal)

|
Posted: Mon, 21. May 12, 12:15 Post subject: |
|
|
| Nicoman35 wrote: |
| Unfortunately, I don't know how to tell the damn programm to choose the right marauder. |
You will have to find something unique to that object, once you do it will be easy to fix the issue. I dont know how the code is set, so cant tell you exactly where to look. I'll have a look at the code later today so I can see what we are talking about.
MFG
Ketraar
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Nicoman35
Joined: 17 Nov 2005
Location: Bochum
|
Posted: Thu, 24. May 12, 23:21 Post subject: |
|
|
Did you have a look on the code, Ketraar?
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Ketraar


Joined: 21 May 2004 Posts: 7258 on topic Location: Guimarães (Portugal)

|
Posted: Thu, 24. May 12, 23:40 Post subject: |
|
|
No sorry, forgot to post in here, seams it requires the PluginManager and I dont have that. If there is a way to get just the code at least I can look at it.
MFG
Ketraar
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Nicoman35
Joined: 17 Nov 2005
Location: Bochum
|
Posted: Fri, 25. May 12, 16:36 Post subject: |
|
|
| Ketraar wrote: |
No sorry, forgot to post in here, seams it requires the PluginManager and I dont have that. If there is a way to get just the code at least I can look at it.
MFG
Ketraar |
No problem, I already thaught so.
Here the section of the md script looking for the Marauder:
| Code: |
.....
<!--This continuously searches for The Marauder and sets important variables for all sub-missions-->
<cue name="Marauder_M01_prepare" comment="Find my Marauder">
<condition>
<check_age value="{player.age}" min="10s"/>
</condition>
<action>
<do_all>
<find_station name="this.TheMarauder" max="1" typename="SS_FAC_DON_MARANI" race="pirate">
<jumps max="75"/>
</find_station>
<load_text fileid="8370"/>
<create_actor name="this.Mechanic" race="boron" character="{8370,31}" face="203" object="this.TheMarauder"/>
</do_all>
</action>
......
|
IMHO
this is the essential line:
| Code: |
<find_station name="this.TheMarauder" max="1" typename="SS_FAC_DON_MARANI" race="pirate">
|
I think, it searches for ONE station called "TheMarauder", race pirate. But as said, I have more than one in the pirate sectors. I found the actor boron mecanic aboard the Marauder shipyard in Brennans Triumph. And I have Brennans Triumph tortuga mod running. Those guys are EVIL and nasty and will not let me dock at their base no matter what.
Now how do I tell the script, to choose the one which has been created by the correlated scripts?
Oh, another question: What is this command doing?:
| Code: |
<condition>
<check_age value="{player.age}" min="10s"/>
</condition>
|
bye
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Ketraar


Joined: 21 May 2004 Posts: 7258 on topic Location: Guimarães (Portugal)

|
Posted: Fri, 25. May 12, 17:42 Post subject: |
|
|
| Nicoman35 wrote: |
Oh, another question: What is this command doing?:
| Code: |
<condition>
<check_age value="{player.age}" min="10s"/>
</condition>
|
bye |
This is a trigger condition, that will activate once your game "age" (that's your playing time including SETA) reaches 10s and above.
As for the find_station, the script looks for an object that has the typename SS_FAC_DON_MARANI. So if there are more than one in your game it will choose any one of them in no particular order.
If you want to know which one the script uses, you can use the MD ref Marauder_M01_prepare.TheMarauder
Alternatively you can change the find_station with a create_station and have it create the "Marauder" at any given spot you want. Make sure to use the exact same MD ref. Marauder_M01_prepare.TheMarauder or this.TheMarauder at the same spot in the script.
For more info on Cue and object Refs -> [Video Tutorial] Mission Director Basics
MFG
Ketraar
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Argonaught.

Joined: 06 Nov 2002 Posts: 1575 on topic Location: Omnipotence rules!

|
Posted: Sat, 26. May 12, 04:40 Post subject: |
|
|
I was going to suggest removing the scripts need entirely and just using MD solo...then create the station and set it to invincible. There would be no need then to have checks running to make sure it's still alive and well.
Argo.
_________________ [MOD]X3TC No Fog / [MOD]X3AP No Fog / [MD]X3TC Menagerie Shipyard / [MD]X3AP Menagerie Shipyard
<==<<Argonaught>>==>
XBTF>XT>X2TT>X3R>X3TC>X3AP
I lurk alot for the most part now
 |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Nicoman35
Joined: 17 Nov 2005
Location: Bochum
|
Posted: Sat, 26. May 12, 10:30 Post subject: |
|
|
| Argonaught. wrote: |
I was going to suggest removing the scripts need entirely and just using MD solo...then create the station and set it to invincible. There would be no need then to have checks running to make sure it's still alive and well.
Argo. |
Oh god! I'm glad when I reach the goal with minimun effort! I am Just watching Ketraars tutorials and try to figure out a simple solution. I'm apprentice at normal scripting. And novice with MD scripting. And I really don't know how to "traduce" the features made by the scripts in md scripting. The marauder is created randomly in some pirate sector, then a message pops up with a hint to its location. Above me to do that all just by md scripting. . I'll try to make a solution this weekend, then present it here (and have Ketraar laughing over it).
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Nicoman35
Joined: 17 Nov 2005
Location: Bochum
|
Posted: Sat, 26. May 12, 21:54 Post subject: |
|
|
Here is what I got so far. The only problem: The variable this.TheMarauder contains an array or group of shipyards. How do I properly check them one by one for the name? This is not covered by your Video tutorials yet . I tried to do it alone, but the cue does not the job as I want to. Would you be so kind and help a bit, Ketraar?
| Code: |
<cue name="Marauder_M01_prepare" version="2" comment="Find my Marauder">
<condition>
<check_age value="{player.age}" min="10s"/>
</condition>
<action>
<do_all>
<find_station group="this.Marauders" multiple="1" typename="SS_FAC_DON_MARANI" race="pirate">
<jumps max="75"/>
</find_station>
<load_text fileid="8370"/>
<set_value name="this.MaraudersCount" exact="{group.object.count@this.Marauders}"/>
<set_value name="this.counter1" exact="0"/>
<do_choose>
<do_when value ="this.MaraudersCount" min="1">
<do_all>
<do_if value="this.counter1" max="this.MaraudersCount">
<set_value name="this.actualMarauder" exact="{group.object.this.counter1@this.Marauders}"/>
<do_if value="{object.name@this.actualMarauder}" exact="The Marauder">
<create_actor name="this.Mechanic" race="boron" character="{8370,31}" face="203" object="this.TheMarauder"/>
</do_if>
<set_value name="this.counter1" operation="add"/>
</do_if>
</do_all>
</do_when>
<do_otherwise>
<timing>
<time min="30s" max="45s"/>
</timing>
<action>
<do_all>
<reset_cue cue="Marauder_M01_prepare"/>
</do_all>
</action>
</do_otherwise>
</do_choose>
</do_all>
</cue>
|
A group item tutorial would be great 
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Ketraar


Joined: 21 May 2004 Posts: 7258 on topic Location: Guimarães (Portugal)

|
Posted: Sat, 26. May 12, 22:25 Post subject: |
|
|
I see what you are trying to do there, and in fact you are not far from it, its much simpler though.
| Code: |
<cue name="Marauder_M01_prepare" version="2" comment="Find my Marauder">
<condition>
<check_age value="{player.age}" min="10s"/>
</condition>
<action>
<do_all>
<find_station group="this.Marauders" multiple="1" typename="SS_FAC_DON_MARANI" race="pirate">
<jumps min="0"/>
</find_station>
<load_text fileid="8370"/>
<do_all exact="{group.object.count@this.Marauders}" counter="counter1">
<do_if value="{object.name@{group.object.{counter@counter1}@this.Marauders}}" exact="The Marauder">
<create_actor name="this.Mechanic" race="boron" character="{8370,31}" face="203" location="crew" object="this.TheMarauder"/>
<incoming_message author="{actoer.name@this.Mechanic}" text="Hello, {player.name}. You can contact me at {object.name@{group.object.{counter@counter1}@this.Marauders}} in {object.sector.name@{group.object.{counter@counter1}@this.Marauders}}"/>
</do_if>
</do_all>
</do_all>
</action>
</cue> |
As you can see once you have the the group from the find, you can extract all sorts of data using existing variables.
The do_all will run as many times as there are stations in the group and the do_if will trigger once the right one within the group is found.
Hope that helps.
And yes this might be worth doing a video, noted.
MFG
Ketraar
PS.: ALso changed the jumps to min=0 as max 75 may just search in range of one, so better make sure it will search all possible sectors. Mind only connected sectors are taken into account.
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
dillpickle

Joined: 03 Nov 2008 Posts: 1043 on topic

|
Posted: Sat, 26. May 12, 22:41 Post subject: |
|
|
The only problem is that in the OP he says that he has more than one Marauder Shipyard - if they are all called 'The Marauder' then you are going to get multiple <create_actor> instances all with the same name on multiple stations which could cause problems...
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Ketraar


Joined: 21 May 2004 Posts: 7258 on topic Location: Guimarães (Portugal)

|
Posted: Sat, 26. May 12, 22:51 Post subject: |
|
|
I thought only one was actually called The Marauder, but its correct, if there are more than one called that way you get more triggers.
This means another, unique way to identify the right one would be needed. But the idea would be the same, just the "conditions" would change.
MFG
Ketraar
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Nicoman35
Joined: 17 Nov 2005
Location: Bochum
|
Posted: Sun, 27. May 12, 00:04 Post subject: |
|
|
| dillpickle wrote: |
| ....- if they are all called 'The Marauder' then you are going to get multiple <create_actor> instances all with the same name on multiple stations which could cause problems... |
In that case I would probably change its Name in the spawn script. Something like "Elite NO.1 one and only Marauder star Shipyard all you can buy!!!"
@ Ketraar
Many, many thanks for that! Where did you learn all that from? Anyway, have a pleasant day. Regards.
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
|
|