Page 1 of 2
[CLOSED] Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 9:37 pm
by sdw195
I think there might be a better way to accomplish what you want.
In 1.04 I've added more data fields to ship classes so you should be able to get what you want. If not, feel free to suggest more data fields until you can accomplish everything with a raw ship class.
On the other hand, if you need to have a real object (instead of a ship class) then you probably need to keep the OnCreate? event because some classes may add devices/items in their OnCreate? call.
i dont think that it will work unless we can get items installed with typGetDataField.
I would reopen the ticket but the tracs broken

Re: Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 9:55 pm
by george moromisato
sdw195 wrote:I would reopen the ticket but the tracs broken

Trac works fine for me, but I just recently upgraded it, so there might be some problem.
Can you tell me what you are seeing?
Re: Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 9:55 pm
by george moromisato
sdw195 wrote:i dont think that it will work unless we can get items installed with typGetDataField.
I would reopen the ticket but the tracs broken

Can you be a little more specific? What are you trying to accomplish?
Re: Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 10:25 pm
by alterecco
george moromisato wrote:sdw195 wrote:I would reopen the ticket but the tracs broken :(
Trac works fine for me, but I just recently upgraded it, so there might be some problem.
Can you tell me what you are seeing?
We are asked to confirm our email address, but the email never gets sent.
Re: Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 10:30 pm
by Star Weaver
alterecco wrote:george moromisato wrote:sdw195 wrote:I would reopen the ticket but the tracs broken

Trac works fine for me, but I just recently upgraded it, so there might be some problem.
Can you tell me what you are seeing?
We are asked to confirm our email address, but the email never gets sent.
Everyone in IRC is having trouble with it like this. TTech reports getting a "DATABASE LOCKED" error, as well.
Re: Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 10:33 pm
by sdw195
george moromisato wrote:
Can you be a little more specific? What are you trying to accomplish?
i am trying to make a dock screen that displays all player ships and allows you to change to them but atm we have to create the ship to get the unids of devices installed on the ship to display there names in the DS so the player knows what they are getting with the ship (eg the battle arena where the weapons, launchers and shields are displayed so the player know what there are fighting)
Edit:
I am trying to make a dock screen that displays all player ships and allows you to change to them. At the moment we have to create the ship to get the unids of devices installed and display the names in the DS (so the player can see what equipment the ship has installed) The issue is that when creating the ship, the OnCreate event can do all kinds of things, like spawn other ships. What I would like is some way to prevent this from happening.
Re: Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 10:45 pm
by george moromisato
alterecco wrote:george moromisato wrote:sdw195 wrote:I would reopen the ticket but the tracs broken

Trac works fine for me, but I just recently upgraded it, so there might be some problem.
Can you tell me what you are seeing?
We are asked to confirm our email address, but the email never gets sent.
Thanks--I disabled email confirmation. It should work now, but let me know otherwise.
Posted: Mon Dec 20, 2010 10:46 pm
by sdw195
yep working
Re: Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 10:52 pm
by george moromisato
sdw195 wrote:I am trying to make a dock screen that displays all player ships and allows you to change to them. At the moment we have to create the ship to get the unids of devices installed and display the names in the DS (so the player can see what equipment the ship has installed) The issue is that when creating the ship, the OnCreate event can do all kinds of things, like spawn other ships. What I would like is some way to prevent this from happening.
As I said in the ticket, I think a better solution is to add data fields that can return all the information that you need from the type (so you don't have to create the ship).
If you could list out the data fields that you need and add them to a ticket, I would be happy to schedule it.
Re: Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 10:58 pm
by Star Weaver
george moromisato wrote:sdw195 wrote:I am trying to make a dock screen that displays all player ships and allows you to change to them. At the moment we have to create the ship to get the unids of devices installed and display the names in the DS (so the player can see what equipment the ship has installed) The issue is that when creating the ship, the OnCreate event can do all kinds of things, like spawn other ships. What I would like is some way to prevent this from happening.
As I said in the ticket, I think a better solution is to add data fields that can return all the information that you need from the type (so you don't have to create the ship).
If you could list out the data fields that you need and add them to a ticket, I would be happy to schedule it.
I think the issues he's worried about are
(a) the information in the <devices> tag section is complex and can be layered with subtables, and
(b) the information in the <devices> tag section can be randomized, and he wants to display a specific randomized configuration and the present it
Basically, he's trying to do (objEnumItems "*I" ...) on a ship that dosen't exist yet, and then, if needed, create the ship with the item list returned the first time.
Perhaps a middle of the road option would be to add a flag to (sysCreateShip) that creates a ship pre-disabled, and the provision that ships created in this way do not run their <oncreate> script until they are first enabled? Then they could never enter play without oncreate happening.
Re: Ticket #535 "add a switch to syscerateship..."
Posted: Mon Dec 20, 2010 11:00 pm
by alterecco
Star Weaver wrote:
Perhaps a middle of the road option would be to add a flag to (sysCreateShip) that creates a ship pre-disabled, and the provision that ships created in this way do not run their <oncreate> script until they are first enabled? Then they could never enter play without oncreate happening.
That is a good idea. Ships could be created Suspended, and not have their OnCreate run until they were Resumed (care should be taken to not run OnCreate every time a ship was resumed).
The one problem I can see (related to the idea behind this whole problem) is that the equipment can be changed once the OnCreate is run, so the player really has no guarantee anyway.
Posted: Mon Dec 20, 2010 11:33 pm
by george moromisato
I really would like OnCreate to be like a constructor. It has to be called before the object is valid. Otherwise, you introduce the complexity of half-created ships.
It's going to be impossible to create a dock screen that works with every conceivable kind of ship. As I said, skipping OnCreate just means that the dock screen will fail for ships that create devices in OnCreate. All you are doing is choosing to support a certain set of ship classes at the expense of a different set of ship classes.
Why not try to restrict to a set of ship classes that follow a certain set of rules?
Posted: Tue Dec 21, 2010 12:03 am
by sdw195
after a chat with alterecco i decided that
Code: Select all
[list]
(typGetDataField Shipclass weapons) returns list of weapon unids
(typGetDataField Shipclass shield) returns shield unid
(typGetDataField Shipclass armor) returns list of armor unids if they are not all the same
[/list]
should do what I want
Posted: Tue Dec 21, 2010 2:10 am
by Star Weaver
sdw195 wrote:after a chat with alterecco i decided that
Code: Select all
[list]
(typGetDataField Shipclass weapons) returns list of weapon unids
(typGetDataField Shipclass shield) returns shield unid
(typGetDataField Shipclass armor) returns list of armor unids if they are not all the same
[/list]
should do what I want
Should it return one random set of possible unids, for the ones with tables? (That way you could create all the data for an instance, wipe the ship, and make all your own items presto. Detailed Ship Config has a 'wipe everything but armor from ship' function if you need it

)
Posted: Tue Dec 21, 2010 2:30 am
by Prophet
The real issue is that you can't have it both ways.
Either you must create the ships and query the ACTUAL items installed (especially ships with device tables) or George might add some data fields to typGetDataField for a very rare case.
What about creating the ship and objSuspend it. Once created you can remove all the devices and install some basic stuff or leave it empty. Then, in your DS, add the option to move your current equipment over when purchased (if switching) or install equipment from your cargo hold?
sdw195 wrote:The issue is that when creating the ship, the OnCreate event can do all kinds of things, like spawn other ships. What I would like is some way to prevent this from happening.
Couldn't you move the scripts that spawn ships into a new event and have them trigger after a short delay with some added logic?
I'm thinking the OnCreate runs a timed event (45 ticks should be fine) and if the ship is not the playership, spawn the extra ships, otherwise do nothing.
This way you can sysCreate the ship and suspend it immediately (halting the delayed event). you can query the items, modify equipment etc, If the player switches to that ship, it will be objResumed at which point the event will fire, find it is the playership and NOT spawn ships.
Just a though
