fodev.net
FOnline Development => Questions and Answers => Topic started by: Peter86A on January 31, 2014, 07:09:44 pm
-
Hi
How to turn on looting in areas like Brotherhood of Steel bunker or Navarro?
I killed npc and cant loot his corpse etc.
-
Most Enclave/BoS soldiers in their bases have guard scripts attached, that's why they can't be looted. You can change it globally in guard.fos module, see line 238 with GuardInit function:
void GuardInit(Critter& guard)
{
_CritSetMode(guard, MODE_NO_ENEMY_STACK);
_CritSetMode(guard, MODE_NO_LOOT);
_CritSetMode(guard, MODE_NO_STEAL);
_CritSetMode(guard, MODE_NO_DROP);
_CritSetMode(guard, MODE_UNLIMITED_AMMO);
_CritSetExtMode(guard, MODE_EXT_NO_WALL_CHECK);
_CritSetExtMode(guard, MODE_EXT_GUARD);
}
By removing or commenting these lines:
_CritSetMode(guard, MODE_NO_LOOT);
_CritSetMode(guard, MODE_NO_STEAL);
_CritSetMode(guard, MODE_NO_DROP);
you will make all guards drop items on death and lootable (all guards, not only BoS/Enclave).
It's not enough to just disable MODE_NO_LOOT, because anti-looting scripts are a bit paranoid and if there is any of these 3 flags set (MODE_NO_LOOT, MODE_NO_STEAL, MODE_NO_DROP), critter won't drop items on death and will delete them instead.
-
Hello and thx for answer.
I did what u say and npcs are lootable now but enclave/brotherhood folks do not drop their armors.
I changed attribute in object editor in power armors to be dropable. In encounters enclave/brotherhood npcs drops their armors but in bases not.
EDIT. Any npc in town did not drop their armors. Vault city, reno etc. only weapons, ammo etc.
Any idea why?
-
Other than guards scripts mentioned by Jovanka, there's another one which does almost same thing; see npc_unlootable.fos
Not sure now, but i think most (if not all) non-guards town NPCs uses it.
-
And what about armors in guards bags Wipe?
Any guard after death do not drop their armor (in random encouters npcs drops armors).
npc_unlootable.fos How to edit this file without any bad consequences like errors etc?
It looks like this:
//
// FOnline: 2238
// Rotators
//
// npc_unlootable.fos
//
#include "_macros.fos"
void critter_init(Critter& guard, bool firstTime)
{
_CritSetMode(guard, MODE_NO_LOOT);
_CritSetMode(guard, MODE_NO_STEAL);
_CritSetMode(guard, MODE_NO_DROP);
}
-
You can simply comment _CritSetMode lines by adding // in front of them:
void critter_init(Critter& guard, bool firstTime)
{
// _CritSetMode(guard, MODE_NO_LOOT);
// _CritSetMode(guard, MODE_NO_STEAL);
// _CritSetMode(guard, MODE_NO_DROP);
}
Also check this Polish AngelScript tutorial: http://forum.newfmc.pl/index.php?board=13.0
-
Obviously! thx
And one more thing, no drop armors by guards issue, any idea with it? :)
-
no idea how it works, maybe they don't have armors at all just armor skin?
-
Awerness perk says they have armors and helmets.
-
There is one more piece of code you need to change, in critter_dead function, main.fos module:
// move all armor items to inventory of npc. delete it if no drop.
if(cr.Stat[ST_REPLICATION_TIME] < 0 && cr.IsNpc())
{
for(uint i = 0, j = items.length(); i < j; i++)
if(items.GetType() == ITEM_TYPE_ARMOR && items.CritSlot != SLOT_INV)
{
if(FLAG(items.Flags, ITEM_NO_STEAL) || FLAG(items.Flags, ITEM_NO_LOOT))
DeleteItem(items);
else
cr.MoveItem(items.Id, 1, SLOT_INV);
}
}
Delete red parts.
I'm not sure if the NoLoot/NoSteal flags have any effect beside the code above, it may be the case that you will have to turn them off in some armor protos like Power Armor. Use Object Editor to do it.
(https://i.cubeupload.com/fYgwAb.gif)
The item dropping is quite a mess as you can see, there are flags in item protos that can influence it, critter parameters, messy scripts in main and replication modules...
-
Thx a lot for you answers.
Problem solved :)
-
Just in case anyone wondering about this topic.
I wanted to remove the no loot, no drop restriction from Ares Silo; I did the above mentioned and didn't quite work out.
I searched around and find out that Ares Silo has it own location specify no loot, no drop restriction.
Go to map_ares.fos, on line 60 you will find the below codes:
// =============================================
// Super Mutants / Critter
// =============================================
void _Mob(Critter& mob, bool firstTime)
{
mob.ModeBase[MODE_NO_LOOT] = 0;
mob.ModeBase[MODE_NO_DROP] = 0;
mob.ModeBase[MODE_NO_STEAL] = 0;
mob.ModeBase[MODE_UNLIMITED_AMMO] = 1;
_CritSetExtMode(mob, MODE_EXT_MOB);
mob.SetEvent(CRITTER_EVENT_IDLE, "_MobIdle");
}
Change the value of the no_loot, no_drop attribute to "0", and now the muties in the base can be looted.
I think other locations may have similar settings.