Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Annoying NPC problem

The general place to discuss MOD''ing Freelancer!

Post Thu Aug 30, 2007 8:30 am

Annoying NPC problem

For my mod, I added an Order base into one of the independant worlds. The problem is, in the area around it, after a few seconds of flying around all the NPCs converge on the middle of it and just sit there. No one docks, flies off, or does anything unless you make them attack you. And this doesn't seem to be a problem with the order; the same thing happens no matter if i change the population type to background or change the base's faction to the liberty navy.

Here's my code:

From the system file:

[Object
nickname = Iw04_03
ids_name = 197409
ids_info = 458944
pos = -2500, 5200, 39000
archetype = o_osiris2
base = Iw04_03_Base
dock_with = Iw04_03_Base
reputation = fc_or_grp
behavior = NOTHING
visit = 0
voice = atc_leg_m01
space_costume = pl_male4_head, pi_orillion_body
difficulty_level = 19
loadout = or_osiris2
pilot = pilot_solar_hardest

[zone
nickname = Zone_Iw04_03
pos = -2500, 4600, 39000
shape = ELLIPSOID
size = 3500, 2500, 3500
visit = 128
comment = Osiris
sort = 99.800000
toughness = 15
density = 6
repop_time = 15
max_battle_size = 8
pop_type = fc_or_grp, single_base_law
music = music_friendly_encouragement
relief_time = 10
faction_weight = li_lsf_grp, 5
encounter = area_elites, 19, 0.030000
faction = fc_or_grp, 1.000000
encounter = area_bh_defend, 19, 0.040000
faction = li_lsf_grp, 1.000000

From mBases.ini:

[MBase
nickname = Iw04_03_Base
local_faction = fc_or_grp
diff = 19

[MVendor
num_offers = 0, 1

[BaseFaction
faction = li_n_grp
weight = 6
npc = iw0403_lnavy_001_m

[BaseFaction
faction = li_lsf_grp
weight = 12
npc = iw0403_lsf_001_f
npc = iw0403_lsf_002_m

[BaseFaction
faction = br_n_grp
weight = 6
npc = iw0403_bnavy_001_m

[BaseFaction
faction = ku_n_grp
weight = 6
npc = iw0403_knavy_001_m

[BaseFaction
faction = rh_n_grp
weight = 6
npc = iw0403_rnavy_001_m

[BaseFaction
faction = fc_bd_grp
weight = 6
npc = iw0403_dragons_001_m

[BaseFaction
faction = fc_b_grp
weight = 6
npc = iw0403_bundschuh_001_m

[BaseFaction
faction = fc_or_grp
weight = 72
offers_missions = true
mission_type = DestroyMission, 0.000000, 0.082100, 100
npc = iw0403_order_001_m
npc = iw0403_order_002_m
npc = iw0403_order_003_m
npc = iw0403_order_004_m
npc = iw0403_order_005_m

RUUUUUUN! GOOOOOOO! GET TO DAH CHOPPAH!!!

Post Thu Aug 30, 2007 9:06 am

i think you should put area trade in there check out this code from the order mod

[zone
nickname = Zone_Hi01_pop_osiris
pos = 42776, 0, -7431
shape = SPHERE
size = 4000
comment = osiris order base
sort = 99.500000
toughness = 19
density = 15
repop_time = 10
max_battle_size = 8
pop_type = fc_or_grp, single_base_law
relief_time = 10
faction_weight = fc_or_grp, 10
density_restriction = 8, lawfuls
encounter = area_scout, 19, 1.000000
faction = fc_or_grp, 1.000000
encounter = area_defend, 19, 1.000000
faction = fc_or_grp, 1.000000
encounter = area_trade_trader, 19, 0.270000
faction = fc_or_grp, 1.000000
i put the encounter area trade where i want the order to land like ryuku base and monkey planet and robot planet and toledo and now they land
http://i8.photobucket.com/albums/a11/rs ... ion.png'/>

Edited by - richard s on 8/30/2007 10:08:21 AM

Post Fri Aug 31, 2007 6:20 pm

Starman Omega, the encounters that you put Zone_Iw04_03 only wander around aimlessly within the zone. This is the behaviour of freelancer. If you want to make ships dock and fly around to other places, then you must build patrol path encounters that have different ini strings than the one you use to make Zone_Iw04_03 zones.

I had the problem too wondering why when I built these encounters, the original encounters would be working with ships going on planned routes.

Then I figured it out, zone encounters like the one you made are not made by Freelancer to do anything but wander around doing nothing unless they are being scanned or enemies are attacking them and they attack.

So I will say again, you will need to make patrol paths and they are very different from the encounter strings you have used. This is one example of a patrol path encounter you must make.

And on a note, once you code it, it exists as a cylindrical bar. One of the ends must be close to a base, gate or dockable object or it will crash the game. Here is one example of the coding:

[zone
nickname = Zone_Li01_path_navy1_1
pos = -58625, 0, 37048
rotate = -90, -71, 0
shape = CYLINDER
size = 750, 50898
sort = 99
toughness = 1
density = 3
repop_time = 90
max_battle_size = 4
pop_type = lane_patrol
relief_time = 30
path_label = navy1, 1
usage = patrol
mission_eligible = True
faction_weight = li_n_grp, 10
density_restriction = 1, patroller
density_restriction = 1, police_patroller
density_restriction = 1, pirate_patroller
density_restriction = 4, lawfuls
density_restriction = 4, unlawfuls
encounter = patrolp_gov_patrol, 1, 0.330000
faction = li_n_grp, 1.000000

As you read the code you will notice significant differences, but I will recommend you read 'Trying to understand encounter.pdf' file because they give you pictorial diagrams there telling you how to do it properly. Just reading this code I advise is not too effective unless you are really good with numbers and are familiar.

Please note the bottom strings

encounter = patrolp_gov_patrol, 1, 0.330000
faction = li_n_grp, 1.000000

notice that the encounter = patrolp_gov_patrol has a significant difference in patrolp_gov_patrol.ini and area_bh_defend.ini you are using. See the examples below

This is your area_bh_defend

[EncounterFormation
ship_by_class = 1, 1, sc_fighters
pilot_job = defend_leader_job
make_class = wanderer
ship_by_class = 0, 1, sc_fighters, -1
pilot_job = defend_job
make_class = wanderer
formation_by_class = fighters
<span style="text-decoration: underline">behavior = wander</span> <==== This is the behaviour for the ships to 'wander' therefore this programs them to move around aimlessly unless they are scanned or are in a hostile situation. If they are not in those two states, they go back to normal of wandering around aimlessly.
arrival = all, -tradelane, -object_jump_gate
allow_simultaneous_creation = yes
zone_creation_distance = 0
times_to_create = infinite

[Creation
permutation = 0, 3

___________________________________________________
___________________________________________________

This is the patrolp_gov_patrol.ini

[EncounterFormation
ship_by_class = 1, 1, sc_fighters
pilot_job = patrol_leader_job
make_class = class_police_patroller
ship_by_class = 3, 7, sc_fighters, -1
pilot_job = patrol_job
formation_by_class = fighters
<span style="text-decoration: underline">behavior = patrol_path</span> <===== not wander but now patrol_path
arrival = cruise
allow_simultaneous_creation = yes
zone_creation_distance = 0
times_to_create = infinite

[EncounterFormation
ship_by_class = 1, 1, sc_fighters
pilot_job = patrol_leader_job
make_class = class_police_patroller
ship_by_class = 3, 15, sc_fighters, -1
pilot_job = patrol_job
formation_by_class = fighters
<span style="text-decoration: underline">behavior = patrol_path</span> <===== not wander but now patrol_path
arrival = cruise
allow_simultaneous_creation = yes
zone_creation_distance = 0
times_to_create = infinite

[Creation
permutation = 0, 3

As you can see the behaviour string has something different, it identifies the patrol_path instead of wander. This commands the game that this is a patrol_path encounter and ships will then take on patrol_path behaviours

<span style="text-decoration: underline"> BUT don't change the area_bh_defend.ini wander into patrol_path!!! It doesn't work that way it will crash the game, because remember the encounter.ini files work in conjunction with the zones within the ini files stored in your individual universe folders!</span>

So this means the patrol kind of encounters in the universe ini's must use encounter.ini files containing the string behaviour = patrol_path and the wandering ones that you have created use only the encounter.ini files using the string behaviour = wander.



Edited by - futuristic m1 on 9/1/2007 6:48:56 AM

Return to Freelancer General Editing Forum