The Feudal States

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

Moderators: winston, another_commander

User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

No crash with me, but when flying with a Jameson to Aronar I also got in the log:

Code: Select all

[dataCache.write.success] OOCacheManager.m:408: Wrote data cache.
[bigShips_populator] OOJSGlobal.m:197: 0 big trader(s) added to the Lave system.
[bigShips_populator] OOJSGlobal.m:197: 3 big trader(s) added to the Zaonce system.
[script.addShips.failed] PlayerEntityLegacyScriptEngine.m:1617: ***** SCRIPT ERROR: in <anonymous actions>, addShipsAtPrecisely: could not add 4 ships with role '-knight'
[bigShips_populator] OOJSGlobal.m:197: 4 big trader(s) added to the Tionisla system.
[script.addShips.failed] PlayerEntityLegacyScriptEngine.m:1617: ***** SCRIPT ERROR: in <anonymous actions>, addShipsAtPrecisely: could not add 4 ships with role '-knight'
[bigShips_populator] OOJSGlobal.m:197: 0 big trader(s) added to the Qutiri system.
[script.addShips.failed] PlayerEntityLegacyScriptEngine.m:1617: ***** SCRIPT ERROR: in <anonymous actions>, addShipsAtPrecisely: could not add 4 ships with role '-knight'
[bigShips_populator] OOJSGlobal.m:197: 2 big trader(s) added to the Aronar system.
[script.addShips.failed] PlayerEntityLegacyScriptEngine.m:1617: ***** SCRIPT ERROR: in <anonymous actions>, addShipsAtPrecisely: could not add 4 ships with role '-knight'
 
So there must be some un-initialised variable as there are a lot of places were:

Code: Select all

system.legacy_addShipsAtPrecisely([missionVariables.feudal_mission_house]+"-knight", 4, "wsu", [0, 0, 0.3])
is used. Looking in my log, it seems he tries to add those ships in every system I entered.

EDIT: found this error in feudal-mission, one of the last lines:

Code: Select all

	if(missionVariables.feudal_mission == "RANSOM_RUNNING" && system.ID == [missionVariables.feudal_mission_location_no])

		system.legacy_addShipsAtPrecisely([missionVariables.feudal_mission_house]+"-lord", 1, "wsu", [0, 0, 0.3])// add the ransom target
		system.legacy_addShipsAtPrecisely([missionVariables.feudal_mission_house]+"-knight", 4, "wsu", [0, 0, 0.3])// add some knights as escort
must be

Code: Select all

	if(missionVariables.feudal_mission == "RANSOM_RUNNING" && system.ID == [missionVariables.feudal_mission_location_no])
		{
		system.legacy_addShipsAtPrecisely([missionVariables.feudal_mission_house]+"-lord", 1, "wsu", [0, 0, 0.3])// add the ransom target
		system.legacy_addShipsAtPrecisely([missionVariables.feudal_mission_house]+"-knight", 4, "wsu", [0, 0, 0.3])// add some knights as escort
		}
Now the second line is not part of the if statement.
Edmund
Above Average
Above Average
Posts: 24
Joined: Mon Oct 26, 2009 11:36 am

Post by Edmund »

Edmund wrote:
Incidentally, My main commanders Griff Cobra MkIII has lost it's custom paint job and decal in the trunk version. The shipdata.plist edits and save game edits are the same as 1.73.4 and it works there.
Ah, scratch that, my red and orange with black decal Cobra has just reappeared. The Feudal States still not working though.

Is it working on anyone's Windoppy XP/Nvidia system?
_________________________

Loving my Cobra since 1985
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Hi,

from the previous test release my commander still has an active tournament in the save file but that couldn't start as it was causing a crash - and now I do wonder whether I should edit my file to get rid of it. If that's the case, what would I have to do?

Furthermore, aside from the shader issues, I've got some script error in the log:

Code: Select all

[script.javaScript.exception.parenAfterArgs]: ***** JavaScript exception (<unidentified script>): SyntaxError: missing ) after argument list
[script.javaScript.exception.parenAfterArgs]:       ../AddOns/The Feudal States v1.0.oxp/Scripts/feudal-promotion.js, line 135: 							mission.feudal_tournament_jumpcount = 0
[script.javaScript.load.failed]: ***** Error loading JavaScript script ../AddOns/The Feudal States v1.0.oxp/Scripts/feudal-promotion.js -- compilation failed
[script.load.notFound]: ***** Could not find a valid script file named feudal-promotion.js.
Screet
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Code: Select all

[script.javaScript.exception.parenAfterArgs]: ***** JavaScript exception (<unidentified script>): SyntaxError: missing ) after argument list
This one is perhaps leading to

Code: Select all

[script.javaScript.load.failed]: ***** Error loading JavaScript script ../AddOns/The Feudal States v1.0.oxp/Scripts/feudal-promotion.js -- compilation failed
[script.load.notFound]: ***** Could not find a valid script file named feudal-promotion.js.
But it's kind of hard to tell, because the first error doesn't mention the script name. So probably they are unrelated.

Code: Select all

[script.javaScript.exception.parenAfterArgs]:       ../AddOns/The Feudal States v1.0.oxp/Scripts/feudal-promotion.js, line 135: 							mission.feudal_tournament_jumpcount = 0
This one is easy. It is "missionVariables.foo", not "mission.foo" (twice, in line 121 and 135).

EDIT: After fixing this I don't get any error messages after starting Oolite. Other errors might be triggered only later, though.
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

Post by Ramirez »

Again, apologies for the errors - there were some last minute tweaks I applied that I evidently didn't test fully. I'll aim to do some fixes at the weekend before I disappear for the holidays. If you encounter any other strange goings on, post them here and I'll pick them up.

Earlier on this week I did come up with a single generic script to handle much of the name and rank generation elements, but I'll put this on the back burner while I fix the more material issues.
Download Resistance Commander plus many other exciting OXPs HERE
Chrisfs
---- E L I T E ----
---- E L I T E ----
Posts: 433
Joined: Sun Sep 20, 2009 10:24 am
Location: California

Post by Chrisfs »

Is there a bug fixed version available on your website or is it still the original version?
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

Post by Ramirez »

I've uploaded a version 1.1 that contains fixes for the errors that have been identified. Haven't had time to do much detailed checking but hopefully this will give you enough to go on for now.

Screet, if you want to use a previous save game for the tournament, you need to make sure two mission variables are present. One should be mission_feudal_tournament_offer, which needs to be set to 'EVENT_BRIEFING'. The other is mission_feudal_tournament, and this should be set to whatever event you're on, e.g. EVENT1, EVENT2, etc.
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

Generic Name & Rank Generator

Post by Ramirez »

Just thought I'd share the results of the work on the generic script I talked about. Quite often there's a need to generate names and ranks for specific characters, and at the moment each world script has a long and convoluted routine to produce these and save them as mission variables. I wanted to put this all into a single generic script, which could be called by different world scripts as necessary.

Several posts ago, Kaks suggested this was doable by attaching a generic function to the player, e.g.

Code: Select all

player.defineChallegerGender = this.defineChallengerGender = function
While this worked, I realised that each thread of the OXP (missions, promotions, tournaments and challenges) all needed to have their own set of variables, often running in parallel. So, for example, the name of a challenger opponent mustn't overwrite the name of a mission target. As a result, I needed to overhaul the way the OXP was handling names and ranks.

Here's how I've handled it. Below is the generic name and rank generator in its entirety (note the logs are just there for test purposes):

Code: Select all

this.name = "feudal-ranks.js";
this.author = "Ramirez";
this.copyright = "December 2009";
this.description = "Script used to generate ranks and names for feudal characters";
this.version = "1.0";

player.feudalRankGenerator = this.feudalRankGenerator = function()

{
    if(player.rankGenerator_house == "Geinona")
    {var rankGenerator_language = "spanish"
    player.rankGenerator_of = "de"}
    
    if(player.rankGenerator_house == "Oreseren" || player.rankGenerator_house == "Aronar")
    {var rankGenerator_language = "dutch"
    player.rankGenerator_of = "van"}
    
    if(player.rankGenerator_house == "Digibeti" || player.rankGenerator_house == "Edzaon")
    {var rankGenerator_language = "english"
    player.rankGenerator_of = "of"}

    if(player.rankGenerator_house == "Esredice" || player.rankGenerator_house == "Ededleen")
    {var rankGenerator_language = "german"
    player.rankGenerator_of = "von"}
    
    if(player.rankGenerator_house == "Gelaed")
    {var rankGenerator_language = "french"
    player.rankGenerator_of = "de"}

    if(player.rankGenerator_house == "Onusorle" || player.rankGenerator_house == "Tibedied")
    {var rankGenerator_language = "swedish"
    player.rankGenerator_of = "af"}
    
    if(player.rankGenerator_house == "Tibecea")
    {var rankGenerator_language = "italian"
    player.rankGenerator_of = "di"}
    
    log([rankGenerator_language])
    log([player.rankGenerator_house])
    log([player.rankGenerator_gender])
       
    player.rankGenerator_feudal_middle_rank = expandDescription("[feudal_middle_"+[rankGenerator_language]+"_"+[player.rankGenerator_gender]+"_rank]"); 
    log([player.rankGenerator_feudal_middle_rank]);
    
    player.rankGenerator_feudal_high_rank = expandDescription("[feudal_high_"+[rankGenerator_language]+"_"+[player.rankGenerator_gender]+"_rank]");
    log([player.rankGenerator_feudal_high_rank]);
    
    player.rankGenerator_feudal_specific_rank = expandDescription("[feudal_level"+[player.rankGenerator_level]+"_"+[rankGenerator_language]+"_"+[player.rankGenerator_gender]+"_rank]");
    log([player.rankGenerator_feudal_specific_rank]);
    
    player.rankGenerator_feudal_firstname = expandDescription("[feudal_firstname_"+[rankGenerator_language]+"_"+[player.rankGenerator_gender]+"]");
    log([player.rankGenerator_feudal_firstname]);
   
    player.rankGenerator_feudal_lastname = expandDescription("[feudal_lastname_"+[rankGenerator_language]+"]");
    log([player.rankGenerator_feudal_lastname]);
       
}
In order to sent some data to this generator, it has to be attached to the player. In the feudal-challenger world script, for example, this is done by doing something like:

Code: Select all

this.defineGeneratorInputs = function()
{
	player.rankGenerator_house = missionVariables.feudal_challenger_house
	player.rankGenerator_gender = missionVariables.feudal_challenger_gender
player.rankGenerator_level = missionVariables.feudal_challenger_rank_no
}
The player.rankGenerator variables are not persistent and only serve to send the data to the generator.

With these details, the generator does its stuff and churns out a load of other variables; the relevant world script picks up the data it wants and saves them as mission variables:

Code: Select all

this.defineGeneratorOutputs = function()
{
	missionVariables.feudal_challenger_of = player.rankGenerator_of
	missionVariables.feudal_challenger_firstname = player.rankGenerator_feudal_firstname
	missionVariables.feudal_challenger_lastname = player.rankGenerator_feudal_lastname
missionVariables.feudal_challenger_rank = player.rankGenerator_feudal_specific_rank
}
In the calling worldscript, you just need to include these three lines in an appropriate function, e.g.:

Code: Select all

this.feudalChallengeOffer = function()
{	
		this.defineGeneratorInputs()
		player.feudalRankGenerator()
		this.defineGeneratorOutputs()}
So, if a script needs say a level 4 female noble from the House of Tibecea, a quick run of the generator will give you Antoinetta Romano, Contessa di Tibecea, and each of those terms will be available to use in the mission text..

The point of all this is that it allows me to expand the OXP into other galaxies while minimising the amount of additional scripting. It also makes it easier to introduce additional languages and ranks as well. The real trick has been working out the syntax to put variables inside the expandDescription parts of the script, as this has done the most to avoid repetition.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Post by JazHaz »

Ramirez wrote:
I've uploaded a version 1.1 that contains fixes for the errors that have been identified. Haven't had time to do much detailed checking but hopefully this will give you enough to go on for now.
Don't know if you are aware, but the download link to this on your website is not working. Luckily the link in your quote above works...
JazHaz

Gimi wrote:
drew wrote:
£4,500 though! :shock: <Faints>
Cheers,
Drew.
Maybe you could start a Kickstarter Campaign to found your £4500 pledge. 8)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!
User avatar
gabbakeisen
Competent
Competent
Posts: 32
Joined: Sun Mar 04, 2007 2:36 am
Location: Front Left-Hand Corner

Post by gabbakeisen »

I downloaded v1.1 running on 1.73.4 on XP with Nvidia and get a crash to desktop on Hyperspace to Aronar too. Removed the oxp and all works fine, does this mean v1.1 still has the same issues? I tried to follow the advice of the comments in this thread but all of those edits seemed to be implimented in 1.1.
WooHoo! My fav game now redone for childhood nostalgia of 20 years ago. Now if only I didn't have to go to work so I could live as a virtual space trader.
User avatar
allikat
Deadly
Deadly
Posts: 191
Joined: Tue Jan 19, 2010 5:45 pm

Post by allikat »

Same situation as gabbakeisen, feudal systems 1.1 on 1.73.4 causes crash do desktop on a jump into Aronar. Disabling the OXP makes everything happy again.

System:
Windows Vista SP2
Amd AthlonII x2 240 (2.8GHz stock normally at 3.5Ghz), 2GB ddr2, stacks'o'drivespace, NVidia GF 8500GT

Yes, I overclock, and I'm proud of it :twisted: but I tested this at stock settings, with a few cache clears as well to be sure.
Commander Monty, a Python Class Cruiser driver :D
Iron assed bulk haulers for the win!

Of the two trumbles which escaped today from Lave station, only 473 have been located....
User avatar
gabbakeisen
Competent
Competent
Posts: 32
Joined: Sun Mar 04, 2007 2:36 am
Location: Front Left-Hand Corner

Post by gabbakeisen »

OK thanks for the confirm allikat. :)
WooHoo! My fav game now redone for childhood nostalgia of 20 years ago. Now if only I didn't have to go to work so I could live as a virtual space trader.
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

Post by Kaks »

Will have a proper look this weekend, to see if we can track down this crash to desktop.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
gabbakeisen
Competent
Competent
Posts: 32
Joined: Sun Mar 04, 2007 2:36 am
Location: Front Left-Hand Corner

Post by gabbakeisen »

thanks kaks :-) no need to hurry tho, no need to turn a labour of love into a ball and chain, especially when its handed out for us adoring masses or free. May you enjoy fine wine, easy women and mountains of hard cash for all eternity (plenty of which can be found on Zaonce despite what the guide books say) :wink:
WooHoo! My fav game now redone for childhood nostalgia of 20 years ago. Now if only I didn't have to go to work so I could live as a virtual space trader.
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

Post by Ramirez »

Following some updates to models used in Asteroid Storm I've uploaded a version 1.2 to resolve any potential clashes.

I can't replicate the crashes to desktop people are having - not sure if it's still shaders or if it's something else. I'll be ready to apply a fix once we know what the problem is!
Download Resistance Commander plus many other exciting OXPs HERE
Post Reply