Page 30 of 46

Re: The Feudal States

Posted: Sun Apr 24, 2011 11:35 am
by Ramirez
Commander McLane wrote:
Another addition would be to rename the functions to this.$disableSystems and this.$restoreSystems, and generally putting a '$' in front of all self-defined functions (as opposed to event handlers). Don't forget to put it in also in the places where the functions are called.

Ahruman would be grateful.
Is this just a convenient way to differentiate between event handlers and functions, or is it more technical than that? Should all self-defined function have $ in these days?

I've put the extra tweaks into v1.10 so that:
- any missiles are re-enabled once the challenge is over or you dock/leave the system while the challenge is still running
- placeholder equipment is used to temporarily disable (rather than damage) energy bombs, fuel injectors and cloaking devices where necessary
- I've made some slight updates the readme to explain things

Give that a go and let me know if there are any issues.

Re: The Feudal States

Posted: Sun Apr 24, 2011 1:03 pm
by JensAyton
Ramirez wrote:
Is this just a convenient way to differentiate between event handlers and functions, or is it more technical than that? Should all self-defined function have $ in these days?
It’s a namespace issue. All properties starting with letters on Oolite-defined objects (including Script objects) are reserved for future use by the game.

Re: The Feudal States

Posted: Wed Apr 27, 2011 10:37 am
by Coeurlion
I seem to be having problems with Feudal States v1.10
The duel system seems to working fine, but if I do a mission (tribute etc), it doesn't show up as a contract (on F5 screen)
but it shows the mission destination on the galactic chart. When I make planetfall and dock, there is no acknowledgement.
It looks like the mission has been 'forgotten' :?

Re: The Feudal States

Posted: Wed Apr 27, 2011 3:08 pm
by m4r35n357
Ramirez wrote:
[*]A Japanese-themed set of houses for Galaxy 6
In G5 ATM, will jump after my next random hit, looking forward to this!

Re: The Feudal States

Posted: Wed Apr 27, 2011 5:05 pm
by Ramirez
Coeurlion wrote:
I seem to be having problems with Feudal States v1.10
The duel system seems to working fine, but if I do a mission (tribute etc), it doesn't show up as a contract (on F5 screen)
but it shows the mission destination on the galactic chart. When I make planetfall and dock, there is no acknowledgement.
It looks like the mission has been 'forgotten' :?
Oops, looks a line of script ended up in the wrong place. Please download the file again and check it resolves the issue.

Note that for the tribute mission, you only need to visit the main station of the mission destination before returning home to the Royal Court.

Re: The Feudal States

Posted: Wed Apr 27, 2011 8:12 pm
by zsozso
I also suspect the reset condition to be a culprit in the function shipExitedWitchspace, which reads;

Code: Select all

if(missionVariables.feudal_mission == "DELIVERY_DECLINED" || "RANSOM_DECLINED" || "EXECUTION_DECLINED" || "RAID_DECLINED" || "ESCORT_DECLINED" || "TRIBUTE_DECLINED")
        {missionVariables.feudal_mission = "NONE_SET"
        mission.setInstructionsKey(null)
        this.resetMissionVariables()}
I have also noticed the missions disappearing after a jump, so I modified the above condition to:

Code: Select all

if(missionVariables.feudal_mission == "DELIVERY_DECLINED" || missionVariables.feudal_mission == "RANSOM_DECLINED" ||
                        missionVariables.feudal_mission == "EXECUTION_DECLINED" || missionVariables.feudal_mission == "RAID_DECLINED" ||
                        missionVariables.feudal_mission == "ESCORT_DECLINED" || missionVariables.feudal_mission == "TRIBUTE_DECLINED")
        {missionVariables.feudal_mission = "NONE_SET"
        mission.setInstructionsKey(null)
        this.resetMissionVariables()}

Re: The Feudal States

Posted: Wed Apr 27, 2011 9:15 pm
by JensAyton
zsozso wrote:
I also suspect the reset condition to be a culprit in the function shipExitedWitchspace, which reads;
Yup; that expression will always evaluate as true. (Specifically, it will always evaluate as either "DELIVERY_DECLINED" or "RANSOM_DECLINED", and non-empty strings are truthy values.)

If you want to avoid the duplication, there are two clean ways:

Code: Select all

switch (missionVariables.feudal_mission)
{
    case "DELIVERY_DECLINED":
    case "RANSOM_DECLINED":
    // ...etc
    case "TRIBUTE_DECLINED":
        missionVariables.feudal_mission = "NONE_SET";
        mission.setInstructionsKey(null);
        this.resetMissionVariables();
        break;
}
or

Code: Select all

if (["DELIVERY_DECLINED", "RANSOM_DECLINED", /* etc */, "TRIBUTE_DECLINED"].indexOf(missionVariables.feudal_mission))
{
    missionVariables.feudal_mission = "NONE_SET";
    mission.setInstructionsKey(null);
    this.resetMissionVariables();
}

Re: The Feudal States

Posted: Wed Apr 27, 2011 10:44 pm
by Ramirez
Can't believe I didn't spot that! Rather than list all the possible variables, this should do the trick as well, shouldn't it?

Code: Select all

if(missionVariables.feudal_mission.indexOf("DECLINED") > 1)
	{missionVariables.feudal_mission = "NONE_SET"
	mission.setInstructionsKey(null)
	this.resetMissionVariables()}

Re: The Feudal States

Posted: Fri Apr 29, 2011 10:36 pm
by Kaks
In this particular case yes, but it wouldn't apply if the variable started with the string 'DECLINED' - just in case, I'd write

Code: Select all

if(missionVariables.feudal_mission.indexOf("DECLINED") >= 0)
instead! Good old "better safe than sorry, so your mum won't have to worry!"... :)


Incidentally, at first sight

Code: Select all

if (["DELIVERY_DECLINED", "RANSOM_DECLINED", /* etc */, "TRIBUTE_DECLINED"].indexOf(missionVariables.feudal_mission))
gives me the impression it'd fail for at least 'DELIVERY_DECLINED' since its indexOf is 0, which is falsy in js.

Re: The Feudal States

Posted: Sat Apr 30, 2011 4:48 am
by JensAyton
Kaks wrote:
Incidentally, at first sight

Code: Select all

if (["DELIVERY_DECLINED", "RANSOM_DECLINED", /* etc */, "TRIBUTE_DECLINED"].indexOf(missionVariables.feudal_mission))
gives me the impression it'd fail for at least 'DELIVERY_DECLINED' since its indexOf is 0, which is falsy in js.
Er, yes. There was supposed to be a != -1 at the end of that.

Re: The Feudal States

Posted: Tue May 03, 2011 8:06 pm
by zsozso
I finally got a tournament invitation, went to the system's Hunting Lodge, but i was told that I need a different ship, my Vortex is banned :(
OK, I traded it in for a Firefly, put on some good upgrades (mil.laser, shield boosters, etc), went back and entered the tournament. First task is supposed to be static shooting game, I was told there are 10 targets around the marker but I just can not find any...

How do they supposed to look like ? Are they supposed to appear on the radar ?
My radar only shows the Lodge and the Tournament buoy. I parked beside the buoy and looked in every possible direction but I could not see anything worth shooting at -- I see stars, planet, sun, buoy and the lodge nothing else.

Re: The Feudal States

Posted: Tue May 03, 2011 10:58 pm
by JD
If memory serves me correctly, you aren't allowed beyond a certain distance from the buoy, but you may have to patrol very close to that perimeter in order to put yourself in scanner range of the targets.

Cheers
John

Re: The Feudal States

Posted: Tue May 03, 2011 10:59 pm
by Mauiby de Fug
You'll have been banned due to the fact that the Vortex has turrets.

The targets, if I recall correctly, are shield shaped. They can be seen on the radar as white blobs, and should be within scanner range of the tournament buoy. Why you can't see them, I don't know...

Re: The Feudal States

Posted: Wed May 04, 2011 4:35 pm
by Ramirez
Sorry, I'm still working through some of the issues remaining since the last update. In particular, I tweaked the hunting lodge's coordinates for the challenges but didn't get around to modifying the same for the tournament aspects. I'll fix this and double check that the tournament events are still working as expected.

Re: The Feudal States

Posted: Sat May 07, 2011 3:29 pm
by Ramirez
Ok I've now included tournament-related updates in a version v1.11 available from my site. As well as fixing some things I've made a few small tweaks which should hopefully improve the playability of some of the events.

JD's tip for the first event is spot on - you may not be able to see the targets initially, but if you move around the buoy a bit the ones furthest out should appear on your scanner. Once you manage to get a visual, you just need to make sure you're still within 5km of the buoy when you take the shot.