The Feudal States

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: The Feudal States

Post 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.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: The Feudal States

Post 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.
Coeurlion
Average
Average
Posts: 13
Joined: Thu Dec 30, 2010 9:20 am
Location: Tasmania, Australia (mainly agricultural, democracy, TL7)

Re: The Feudal States

Post 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' :?
*Neil voice from 'The Young Ones' "Ouch, ouch! That laser's really hot! Heavy!"

Current stats:
Ship: Cobra Courier 'Hermes'
Rating: Deadly
Location: Galaxy 1 (again!)
m4r35n357
---- E L I T E ----
---- E L I T E ----
Posts: 296
Joined: Wed Jan 19, 2011 4:00 pm

Re: The Feudal States

Post 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!
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: The Feudal States

Post 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.
Download Resistance Commander plus many other exciting OXPs HERE
zsozso
Above Average
Above Average
Posts: 23
Joined: Tue Apr 12, 2011 3:54 pm
Location: Toronto, Canada

Re: The Feudal States

Post 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()}
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: The Feudal States

Post 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();
}
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: The Feudal States

Post 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()}
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: The Feudal States

Post 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.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: The Feudal States

Post 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.
zsozso
Above Average
Above Average
Posts: 23
Joined: Tue Apr 12, 2011 3:54 pm
Location: Toronto, Canada

Re: The Feudal States

Post 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.
JD
Deadly
Deadly
Posts: 182
Joined: Thu Nov 25, 2010 10:42 pm
Location: London, UK

Re: The Feudal States

Post 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
User avatar
Mauiby de Fug
---- E L I T E ----
---- E L I T E ----
Posts: 847
Joined: Tue Sep 07, 2010 2:23 pm

Re: The Feudal States

Post 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...
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: The Feudal States

Post 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.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: The Feudal States

Post 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.
Download Resistance Commander plus many other exciting OXPs HERE
Post Reply