Scripting requests
Moderators: winston, another_commander
- Cmdr James
- Commodore
- Posts: 1357
- Joined: Tue Jun 05, 2007 10:43 pm
- Location: Berlin
I added this verbatim. If it breaks anything the next commit includesPhantorGorth wrote:Request:
Either
a) Modification to the position of the call to guiScreenChange when entering the Equipment Screen to before the calculation of the available equipment.
or
b) New event of guiBeforeScreenChange that occurs before any calculations for the target screen.
Code: Select all
if (player.equals(Phantor_Gort))
{
player.ship.add(trumble);
}
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
ROFL that's easy to get roundCmdr James wrote:I added this verbatim. If it breaks anything the next commit includesCode: Select all
if (player.equals(Phantor_Gort)) { player.ship.add(trumble); }
- Lestradae
- ---- E L I T E ----
- Posts: 3095
- Joined: Tue Apr 17, 2007 10:30 pm
- Location: Vienna, Austria
..
I am getting the impression you devs are a bit touchy about not-absolutely-nescessary scripting requests atm, no?Cmdr James wrote:I added this verbatim. If it breaks anything the next commit includesPhantorGorth wrote:Request:
Either
a) Modification to the position of the call to guiScreenChange when entering the Equipment Screen to before the calculation of the available equipment.
or
b) New event of guiBeforeScreenChange that occurs before any calculations for the target screen.Code: Select all
if (player.equals(Phantor_Gort)) { player.ship.add(trumble); }
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
Re: ..
That was humour between me and Cmdr James referring to the code changes I had requested having been tested by me but not exhaustively.Lestradae wrote:I am getting the impression you devs are a bit touchy about not-absolutely-nescessary scripting requests atm, no?
The devs can correct me if I am wrong but from what I can gather the devs are reducing the number of code changes in advance of releasing 1.74. Otherwise they won't be releasing it before hell freezes over.
The difference with my change, other than me ambushing Cmdr James , is that I didn't just make a request, I gave actual code changes which I had tested myself. Cmdr James didn't need to spend time figuring out how to do it for me. He only had to check if it caused a problem.
With devs' limited time and 1.74 approaching, you can expect that anything complex, requires significant investigation on how to do it, makes major changes to the game's "philosophy" or doesn't personally interest them is going to be dropped or very low on their priority scale.
- Lestradae
- ---- E L I T E ----
- Posts: 3095
- Joined: Tue Apr 17, 2007 10:30 pm
- Location: Vienna, Austria
Re: ..
I know that and am even quite happy about it because it means that 1.74 and even the "no-longer-M" NSR 1.75 are going to become a reality in mid-term future.PhantorGorth wrote:With devs' limited time and 1.74 approaching, you can expect that anything complex, requires significant investigation on how to do it, makes major changes to the game's "philosophy" or doesn't personally interest them is going to be dropped or very low on their priority scale.
But don't tell anyone, or they will ignore my suggestions to 100% instead of 95%
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
I think Cmd James can already start writing the additional trumble code as the new change at least breaks the current constrictor mission. (at a very mildly invisible way)PhantorGorth wrote:That was humour between me and Cmdr James referring to the code changes I had requested having been tested by me but not exhaustively.
When the guiScreenChanged fires it transfers a TO and FROM parameter. But because an other script could already have changed the page in the meantime (e.g. snoopers that adds a missionscreen when going to the F7 page), the constrictor mission checks for the actual page on display before adding the hints below the system description. Now it also adds the text when leaving the F7 screen to the F3 screen. Probably not a visible bug as the double added text below the F7 screen will immediately disappear when the F3 page is generated.
I could also imagine anyone trying to set up a missionscreen when going to the F3 screen (Like snoopers for the F7 screen and Bloomberg market for the F8 screen) has a problem as that screen will be overwritten by the F3 screen that is added afterwards.
I think it can be made more foolproof by adding some extra checks to the code. But why not add an extra handler instead: guiScreenWillChangeTo. That way you have no exception for the time of firing for the current guiScreenChanged handler on the equip page?
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
That is definately not something I had considered nor tested for (I never said I had fully tested it) but in my original request post I did mention the idea of doing a "guiScreenWillChangeTo" event instead (though I called it "guiBeforeScreenChange").Eric Walch wrote:I could also imagine anyone trying to set up a missionscreen when going to the F3 screen (Like snoopers for the F7 screen and Bloomberg market for the F8 screen) has a problem as that screen will be overwritten by the F3 screen that is added afterwards.
I think it can be made more foolproof by adding some extra checks to the code. But why not add an extra handler instead: guiScreenWillChangeTo. That way you have no exception for the time of firing for the current guiScreenChanged handler on the equip page?
I suggest someone reverses that change Cmdr James did for me and I will look into where to put the "guiScreenWillChangeTo" event and the code needed for the event function itself. The call to it would be needed in a fair few number of places.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
I now implemented it as guiScreenWillChange. Yet another name but it matches better with the current "guiScreenChanged". Leaving the old handler on its place leaves the possibility to start a missionscreen on entering those pages with the "guiScreenChanged". e.g. for doing a very special equipment offer on entering the equip screen.PhantorGorth wrote:but in my original request post I did mention the idea of doing a "guiScreenWillChangeTo" event instead (though I called it "guiBeforeScreenChange")..
And because the only use for the "guiScreenWillChange" will be to do some modifications to change the screen that will be displayed, it only triggers for a few screens were it could be used in that way.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
Thanks Eric. Much appreciated.Eric Walch wrote:I now implemented it as guiScreenWillChange. Yet another name but it matches better with the current "guiScreenChanged". Leaving the old handler on its place leaves the possibility to start a missionscreen on entering those pages with the "guiScreenChanged". e.g. for doing a very special equipment offer on entering the equip screen.
And because the only use for the "guiScreenWillChange" will be to do some modifications to change the screen that will be displayed, it only triggers for a few screens were it could be used in that way.
It would be pretty nice if performAttack could be influenced by scripts.
The current way - I think - works pretty well for escorts in groups of ships and prevents the player from being roasted too fast, but single ships with odd IDs are still problematic in mission contexts, specially if wormholing or heavy injector usage would break the story.
So maybe it would be an option if the decision (check odd/even) would consider some other factors too. Bounty, accuracy and a scriptable (read/write) property - e.g. Ship.maxAggression (JS) and max_aggression (shipdata) - maybe?
The current way - I think - works pretty well for escorts in groups of ships and prevents the player from being roasted too fast, but single ships with odd IDs are still problematic in mission contexts, specially if wormholing or heavy injector usage would break the story.
So maybe it would be an option if the decision (check odd/even) would consider some other factors too. Bounty, accuracy and a scriptable (read/write) property - e.g. Ship.maxAggression (JS) and max_aggression (shipdata) - maybe?
We have a world script event for shipLostTarget, but we seem to be lacking in it's mirror image - shipAcquiredTarget(target).
Would such a trigger be possible, firing when the ships target goes from null to something, or something to something else?
Would such a trigger be possible, firing when the ships target goes from null to something, or something to something else?
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
We actually do have it already in trunk: ship.shipTargetAcquired(target).Thargoid wrote:We have a world script event for shipLostTarget, but we seem to be lacking in it's mirror image - shipAcquiredTarget(target).
Would such a trigger be possible, firing when the ships target goes from null to something, or something to something else?
Now that's what I call service!
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
The naming is inconsistent. Since shipLostTarget() is already deployed and subject-verb-object is the most common word pattern in both English and Oolite message handler names, I suggest we switch to shipAcquiredTarget().
E-mail: [email protected]