localhero oxp ALPHA

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

Moderators: another_commander, winston

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 »

I'm in Galaxy 4 and even
Change the condition "galaxy_number lessthan 4" into "galaxy_number lessthan 5". But you have to do it also in the shipData.plist I think. (depending on the testversion you ae using.) I was in galaxy 5 and had to change the last version at several places to test the program in an unintended system.

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

davcefai wrote:
I'm in Galaxy 4 and even when I'm at a TL 10 Democratic system there is a distinct lack of local heros.
Thanks Eric for answering this question.

I've uploaded a new version with a check for galaxy_number greaterthan 5. But be aware that this can change, because it's not a final version. If you are using a version number before 0.113 please download the latest release http://wiki.alioth.net/index.php/Localhero_OXP.
You can find the current version in script.plist.
Currently I began to balance the missions, but there are some things left on my todo-list (for example the escortAI).

EDIT: Link changed to the WIKI
Last edited by Svengali on Sat Jan 05, 2008 1:55 pm, edited 1 time in total.

User avatar
davcefai
---- E L I T E ----
---- E L I T E ----
Posts: 400
Joined: Sun Dec 03, 2006 9:07 pm

Post by davcefai »

I'm going to try this. (Got some plastering to do first ) :(

However I thought that Galaxies were numbered from 0, internally. Which means that Galaxy 4 would be 3 and therefore I am within the range.

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

davcefai wrote:
I'm in Galaxy 4 and even when I'm at a TL 10 Democratic system there is a distinct lack of local heros.
The mission were offered in Confederacy systems! Not in Democracies. Sorry I have to read it carefully.
The main conditions are:
galaxy_number <5 - First 5 galaxies
legalStatus_number <7 - Nearly absolute clear
score_number (kills) >50 - no absolutely rookie
systemTechLevel_number >7 - Good to top Tech-Level
systemGovernment_number 5 - Confederacy

User avatar
nijineko
---- E L I T E ----
---- E L I T E ----
Posts: 353
Joined: Wed Jul 04, 2007 3:37 pm
Location: two strange quarks short of a graviton....
Contact:

Post by nijineko »

i'll have to check and see what my status is.
arukibito ga michi wo erabu no ka, michi ga arukibito wo erabu no deshou ka?

Image
Play games. Win Amazon gift cards! Brag. Repeat.

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

The next step is done.

I've balanced the game for the first missions (up to mission 15) and added a nice new feature. Changing pics based on your success.
But if you already have a saved game with an outdated version (before V0.115), please download the newest one.
http://wiki.alioth.net/index.php/Localhero_OXP
and use the included updater. It will add the newly introduced variable to your save-game.

You can use both OXP's at a time. Load your save-game, wait till the message is displayed and save.
After this procedure you can delete the update-OXP.

EDIT: Link changed to the WIKI
Last edited by Svengali on Sat Jan 05, 2008 1:55 pm, edited 1 time in total.

User avatar
TGHC
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

Pretty spectacular for a first OXP.

Excellent :)
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"

User avatar
HueijRevisited
Dangerous
Dangerous
Posts: 96
Joined: Sat Sep 23, 2006 7:10 pm
Location: Arnhem, The Netherlands
Contact:

Post by HueijRevisited »

In the first post you wrote that this OXP is for 1.69. I'm still on 1.65 but would like to play this one. Does it work in 1.65?

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

TGHC wrote:
Pretty spectacular for a first OXP.
It was a lot of work, but I got a lot of help from Eric Walch. His hints about problems in the script and shipdata (and often a solution for that) are a source of wisdom. And his work in updating the WIKI is also a great one. :D

HueijRevisited wrote:
Does it work in 1.65?
Sorry. I really don't know. I think it will, because the OXP doesn't use any untested or totally new commands. Maybe one of the good guys can clear this? Or test it on your own and give me a call.

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 »

[quote="Svengali"]11. Always think about that the order of methods is relevant!
Every AI-Method has an intention. Try to find out what a method should cause and under what kind of
circumstances it is executed. And be aware that this behaviour seems to be varying from case to case.
Examples:

Code: Select all

	"setDesiredRangeTo: 12000.0", performFlee			does not work*
	performFlee, "setDesiredRangeTo: 12000.0"			works*
			but
	"setDesiredRangeTo: 12000.0", performIntercept		works*
	performIntercept, "setDesiredRangeTo: 12000.0"		does not work*
* as intended in the harkovraidAIs
/quote]

I just looked in the C-code and it actually should not matter if range is set first or last. The function setDesiredRangeTo: only sets the ships variable desired_range

Code: Select all

- (void) setDesiredRangeTo:(NSString *)rangeString
{
	desired_range = [rangeString doubleValue];
}
performFlee and performIntercept do nothing with the range but only set a "behavior" flag. When the right flag is set it, it will run one of next two routines on every update time. In the start of both routines it every time calculates the actual distance to the target and compares it with the last defined desired_range.

Code: Select all

- (void) behaviour_intercept_target:(double) delta_t
{
	double  range = [self rangeToPrimaryTarget];
	desired_speed = maxFlightSpeed;
	if (range < desired_range)
		[shipAI reactToMessage:@"DESIRED_RANGE_ACHIEVED"];
	 else .......

Code: Select all

- (void) behaviour_flee_target:(double) delta_t
{
	double  range = [self rangeToPrimaryTarget];
	if (range > desired_range)
		[shipAI message:@"REACHED_SAFETY"];
	else ......
So this means that you even can change the desired_range during the intercept or flee. When it didn't work for you, you probably redefined the range in an other part of the state. But to prevent starting with a range of zero, better define the range first.

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

So this means that you even can change the desired_range during the intercept or flee. When it didn't work for you, you probably redefined the range in an other part of the state. But to prevent starting with a range of zero, better define the range first.
Thanks Eric,

that clears a lot, but a little questionmark is still there. When I started this OXP I wrote some testAIs without any hostile behaviour. The AI switches only between two parts with performFlee and performIntercept in it - I have had used these methods like a performFlyToRange - and it didn't work. Maybe I'm wrong (I can't prove it anymore - deleted the old files). Anyway.
But since your hint I'm always defining a range before any fly-to-method. :wink:

OK. Next version (v0.118) is online. Balanced up to mission 21.
http://wiki.alioth.net/index.php/Localhero_OXP
Disembodied made a complete overhaul on missiontexts and descriptions - 8)

EDIT: Link changed to the WIKI
Last edited by Svengali on Sat Jan 05, 2008 1:56 pm, edited 1 time in total.

User avatar
TGHC
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

That's what I really like about this community, unselfish colaboration and helping each other.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

HueijRevisited wrote:
In the first post you wrote that this OXP is for 1.69. I'm still on 1.65 but would like to play this one. Does it work in 1.65?
I've installed V1.65 and played some missions. The Oxp seems to work under V1.65.
Is there a list out there under which version methods/messages are introduced or deprecated?

Next version is online (V0.120). http://wiki.alioth.net/index.php/Localhero_OXP

TGHC wrote:
That's what I really like about this community, unselfish colaboration and helping each other.
Yes, totally right. And always with a smile. Thanks a lot.

But back to business. I've posted it before: NPC attacking slow moving vessel. If a NPC (already got a target) should execute performAttack he often got some trouble with facing the target. Is performAttack broken or is it a feature? It happens under 1.65 and 1.69.1-test with or without installed Oxps.

EDIT: Link changed to the WIKI
Last edited by Svengali on Sat Jan 05, 2008 1:57 pm, edited 1 time in total.

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 »

I've posted it before: NPC attacking slow moving vessel. If a NPC (already got a target) should execute performAttack he often got some trouble with facing the target. Is performAttack broken or is it a feature?
I think it is a feature, but I never saw these problems. But after performAttack, the ship can have about 5 different behaviors. With the 1.69.1 debugging key you can see the current behavior of the ship. Maybe this gives a clue to the problem. Maybe it could come from the physics of the ship itself. Has an other ship the same problem?
I've installed V1.65 and played some missions. The Oxp seems to work under V1.65.
Is there a list out there under which version methods/messages are introduced or deprecated?
No but on the wiki it usually tells you when it is a post 1.65 command. And there are very few new commands with normal scripting so most 1.69 things will work under 1.65

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Eric Walch wrote:
I think it is a feature, but I never saw these problems. But after performAttack, the ship can have about 5 different behaviors. With the 1.69.1 debugging key you can see the current behavior of the ship. Maybe this gives a clue to the problem. Maybe it could come from the physics of the ship itself. Has an other ship the same problem?
Thanks Eric. But that's why I'm wondering. It doesn't matter what kind of ship it is. But it only happens if there are more than one of them on the run (pirate ambush for example). I tried it without installed OXPs, with some of them and with my own one. With Version 1.65 and 1.69.1-test. Always the same. Some of them didn't get the right direction.
Intel Core 2 Duo, WIN XP SP2, 2 Gig Ram, Nvidia GeForce 7950 Go (512MB) latest driver
Here a dump of a ingame-ship:
[dumpState.entity]: Universal ID: 173
[dumpState.entity]: Scan class: CLASS_NEUTRAL
[dumpState.entity]: Status: STATUS_IN_FLIGHT
[dumpState.entity]: Position: (14890.8, -13585.2, 127596)
[dumpState.entity]: Orientation: (-0.509435 - 0.202024i - 0.831233j + 0.093355k)
[dumpState.entity]: Distance travelled: 75490.8
[dumpState.entity]: Energy: 211.998 of 250
[dumpState.entity]: Mass: 22592.2
[dumpState.entity]: Flags: isShip, hasMoved, isSunlit, collisionTestFilter
[dumpState.shipEntity]: Name: Gecko
[dumpState.shipEntity]: Roles: pirate
[dumpState.shipEntity]: Subentity count: 1
[dumpState.shipEntity]: Time since shot: 100281
[dumpState.shipEntity]: Behaviour: BEHAVIOUR_ATTACK_FLY_TO_TARGET_TWELVE
[dumpState.shipEntity]: Target: <PlayerEntity Cobra Mark III 100>
[dumpState.shipEntity]: Destination: (13247.6, -13487.2, 126728)
[dumpState.shipEntity]: Other destination: (0, 0, 0)
[dumpState.shipEntity]: Waypoint count: 0
[dumpState.shipEntity]: Desired speed: 75
[dumpState.shipEntity]: Fuel: 0
[dumpState.shipEntity]: Fuel accumulator: 1
[dumpState.shipEntity]: Missile count: 1
[dumpState.shipEntity.ai]: AI:
[dumpState.ai]: State machine name: pirateAI.plist
[dumpState.ai]: Current state: ATTACK_SHIP
[dumpState.ai]: Next think time: 284.078
[dumpState.ai]: Next think interval: 284.078
[dumpState.shipEntity]: Frustration: 0
[dumpState.shipEntity]: Success factor: 14549
[dumpState.shipEntity]: Shots fired: 0
[dumpState.shipEntity]: Hull temperature: 60
[dumpState.shipEntity]: Heat insulation: 1
[dumpState.shipEntity]: Flags: has_scoop, escortsAreSetUp, isFrangible

And even when they come under fire, the direction is not corrected until ENERGY_LOW is received. Strange. It seems that they don't make the move till the end. They are flying nearly to the attacker but not totally.

Post Reply