Sensuki
Arcane
Might as well download it myself and see if I can reproduce the issue.
No, it's in GameState.FinalizeLevelLoad()I can see the GameState.OnLevelWasLoaded() method with the area name, is this the one?
Yes it would work. It's likely that you only have to create him once (if an NPC has some component, mobile-something, I think it stays on the map forever), so you'll also have to run a check on global variables if you already visited this area at least once or not. In case such global vars don't exist, you'll have to make them yourself.Would something like this work?
if (area_name == "dyrford")
{
create_npc_from_prefab();
assign_dialog_from_prefab(); // how to do this?
}
Idk, have a look at a few NPCs in GameObject Browser to see what's what.// how to do this?
Don't know about quests, but dialogues are external files in the game folder somewhere (don't remember the path exactly).Can we add a brand new dialog/quest to the resources without using Unity?
static void CreateNPC(string prefab_name, string sheet_name)
{
Console.AddMessage("Starting test...", UnityEngine.Color.red);
UnityEngine.GameObject test_npc;
test_npc = GameResources.LoadPrefab<UnityEngine.GameObject>(prefab_name, true);
if(test_npc == null) return;
Console.AddMessage("Creature loaded: "+prefab_name, UnityEngine.Color.red);
test_npc.transform.position = GameInput.WorldMousePosition;
test_npc.transform.rotation = GameState.s_playerCharacter.transform.rotation;
if(test_npc.GetComponent<Faction>() != null)
{
test_npc.GetComponent<Faction>().RelationshipToPlayer = Faction.Relationship.Neutral;
test_npc.GetComponent<Faction>().CurrentTeamInstance = Team.GetTeamByTag("player");
}
if(test_npc.GetComponent<AIPackageController>() != null)
{
test_npc.GetComponent<AIPackageController>().ChangeBehavior(AIPackageController.PackageType.DefaultAI);
test_npc.GetComponent<AIPackageController>().InitAI();
}
StreamReader file1 = new StreamReader(sheet_name);
if(file1 == null) return;
test_npc.GetComponent<CharacterStats>().BaseConstitution = int.Parse(file1.ReadLine());
test_npc.GetComponent<CharacterStats>().BaseDexterity = int.Parse(file1.ReadLine());
test_npc.GetComponent<CharacterStats>().BaseIntellect = int.Parse(file1.ReadLine());
test_npc.GetComponent<CharacterStats>().BaseMight = int.Parse(file1.ReadLine());
test_npc.GetComponent<CharacterStats>().BasePerception = int.Parse(file1.ReadLine());
test_npc.GetComponent<CharacterStats>().BaseResolve = int.Parse(file1.ReadLine());
file1.Dispose();
// serialize .conversation, .stringtable ?
// test_npc.GetComponent<Conversation>().Load(conv_name); ?
}
Yeah, see how they're loaded and do the same thing.The problem is, can I just add a string table and a dialog file without serializing it?
Why not? ChangeName only changes its overridename or something like that. It's still got the same gameobject name. Or any gameobject name that you assign it in the code. So in your case, just do test_npc.name = "TestNpc"; and then you can access it like that.If you duplicate a creature and change its name it is not usable by console commands even though it exists in the folder.
You can, sure. Or you can just create an empty gameObject and do AddComponent a few times to add the same components that any NPC has. So you can just make a function that creates an npc only using code, or you can make a prefab. Your choice. I think it's easier to do it in the code, until someone can fix the asset editor.This is why I asked if we had to create dummy "pre-srialized" resources for modders to fiddle with.
Well like I said, have a look at existing NPCs with GameObject Browser to see what they have on their dialogue-related components and then do the same thing.If I could somehow find a way to make the last two commented lines happen it would be awesome...
How long before you guys make amod that allows me to enjoy PoE?a real IE successor which allows me to forget the travesty which was PoE
How long before you guys make amod that allows me to enjoy PoE?a real IE successor which allows me to forget the travesty which was PoE
Somewhere in the registry, along with all the other poe's settings.Does anyone know if the saved UI positions are externalized, and where I can find them? I'd like to backup certain UI configurations.
I believe there was an announcement that they wanted to change stealth implementation themselves, because the release version was just for stability.Is it likely that someone will eventually make a mod that allows characters to stealth individually, or is there some gameplay reason why this couldn't be done?
I've been using this modification for a while, and found that it made the weight of text (character sheet, item descriptions) really uneven at 1920x1200. I can get about the same map sharpness without the text distortion using these settings (LumaSharpen is the only option enabled in the SweetFX_settings.txt file)yeah, download and install the latest one from here and use my settings-file. You can tune the sharpness up/down if you like to by changing one line under "LumaSharpen settings":
#define sharp_strength 0.60 // [0.10 to 3.00] Strength of the sharpening
So, download sweetfx and install, copy my settings-file to \pillars of eternity\sweetfx\
/*-----------------------------------------------------------.
/ LumaSharpen settings /
'-----------------------------------------------------------*/
// -- Sharpening --
#define sharp_strength 0.50 //[0.10 to 3.00] Strength of the sharpening
#define sharp_clamp 0.045 //[0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035
// -- Advanced sharpening settings --
#define pattern 3 //[1|2|3|4] Choose a sample pattern. 1 = Fast, 2 = Normal, 3 = Wider, 4 = Pyramid shaped.
#define offset_bias 4.0 //[0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern.
//I designed the pattern for offset_bias 1.0, but feel free to experiment.
// -- Debug sharpening settings --
#define show_sharpen 0 //[0 or 1] Visualize the strength of the sharpen (multiplied by 4 to see it better)
// BEGIN MOD
[DllImport("user32.dll", SetLastError = true, PreserveSig = false)]
private static extern short /* GameInput:: */ GetKeyState(IntPtr keyCode);
public static bool /* GameInput:: */ GetScrollLock()
{
return (bool)(GetKeyState(0x91) & 1);
}
// END MOD
/*
.class public auto ansi GameInput
//...
// BEGIN MOD
.method private hidebysig static pinvokeimpl("user32.dll" lasterr winapi) int16 GetKeyState(native int keyCode) cil managed
{
}
.method public hidebysig static bool GetScrollLock() cil managed
{
.maxstack 8
ldc.i4 0x91
call int16 GameInput::GetKeyState(native int)
ldc.i4.1
and
ret
}
// END MOD
*/
private void /* Player:: */ Update()
{
//...
if (GameInput.GetControlDownWithoutModifiers(MappedControl.ROTATE_FORMATION) || GameInput.GetControlDownWithoutModifiers(MappedControl.MOVE))
{
this.FormationRotationPickPosition = GameInput.WorldMousePosition;
this.m_ignoreNextMoveControlUp = false;
// BEGIN MOD
if ((GameCursor.ActiveCursor == GameCursor.CursorType.Walk) && !GameInput.GetScrollLock())
Camera.main.GetComponent<CameraControl>().FocusOnPoint(GameInput.WorldMousePosition, 1.5f);
// END MOD
}
//...
}
/*
IL_08cf: ldc.i4.s 9
IL_08d1: call bool GameInput::GetControlDownWithoutModifiers(valuetype MappedControl)
IL_08d6: brtrue IL_08e6
IL_08db: ldc.i4.3
IL_08dc: call bool GameInput::GetControlDownWithoutModifiers(valuetype MappedControl)
IL_08e1: brfalse IL_08f8
IL_08e6: ldarg.0
IL_08e7: call valuetype [UnityEngine]UnityEngine.Vector3 GameInput::get_WorldMousePosition()
IL_08ec: call instance void Player::set_FormationRotationPickPosition(valuetype [UnityEngine]UnityEngine.Vector3)
IL_08f1: ldarg.0
IL_08f2: ldc.i4.0
IL_08f3: stfld bool Player::m_ignoreNextMoveControlUp
// BEGIN MOD
call valuetype GameCursor/CursorType GameCursor::get_ActiveCursor()
ldc.i4.2
bne.un IL_08f8
call bool GameInput::GetScrollLock()
brtrue IL_08f8
call class [UnityEngine]UnityEngine.Camera [UnityEngine]UnityEngine.Camera::get_main()
callvirt instance !!0 [UnityEngine]UnityEngine.Component::GetComponent<class CameraControl>()
call valuetype [UnityEngine]UnityEngine.Vector3 GameInput::get_WorldMousePosition()
ldc.r4 1.5
callvirt instance void CameraControl::FocusOnPoint(valuetype [UnityEngine]UnityEngine.Vector3, float32)
// END MOD
IL_08f8:
*/
public void /* UIWindowManager:: */ WindowShown(UIHudWindow window)
{
//...
if (window.EatsKeyInput && (CameraControl.Instance != null)
// BEGIN MOD
&& GameInput.GetScrollLock())
// END MOD
{
CameraControl.Instance.EnablePlayerControl(false);
}
}
/*
IL_014f: ldarg.1
IL_0150: ldfld bool UIHudWindow::EatsKeyInput
IL_0155: brfalse IL_0174
IL_015a: call class CameraControl CameraControl::get_Instance()
IL_015f: call bool [UnityEngine]UnityEngine.Object::op_Implicit(class [UnityEngine]UnityEngine.Object)
IL_0164: brfalse IL_0174
// BEGIN MOD
call bool GameInput::GetScrollLock()
brfalse IL_0174
// END MOD
IL_0169: call class CameraControl CameraControl::get_Instance()
IL_016e: ldc.i4.0
IL_016f: callvirt instance void CameraControl::EnablePlayerControl(bool)
IL_0174: ret
*/
public void /* CameraControl:: */ DoUpdate()
{
//...
if (this.PlayerScrollEnabled
// BEGIN MOD
&& !UINoClick.MouseOverUI && GameCursor.UiObjectUnderCursor == null)
// END MOD
{
float axisRaw = Input.GetAxisRaw("Mouse ScrollWheel");
//...
}
if (GameInput.GetDoublePressed(KeyCode.Mouse0, true) && !UINoClick.MouseOverUI
// BEGIN MOD
&& GameCursor.UiObjectUnderCursor == null)
// END MOD
//...
}
/*
IL_0074: ldarg.0
IL_0075: call instance bool CameraControl::get_PlayerScrollEnabled()
IL_007a: brfalse IL_00a7
// BEGIN MOD
call bool UINoClick::get_MouseOverUI()
brtrue IL_00a7
ldsfld class [UnityEngine]UnityEngine.GameObject GameCursor::UiObjectUnderCursor
call bool [UnityEngine]UnityEngine.Object::op_Implicit(class [UnityEngine]UnityEngine.Object)
brtrue IL_00a7
// END MOD
IL_007f: ldstr "Mouse ScrollWheel"
IL_0084: call float32 [UnityEngine]UnityEngine.Input::GetAxisRaw(string)
IL_0089: stloc.1
IL_008a: ldloc.1
IL_008b: ldc.r4 0.0
IL_0090: beq IL_00a7
IL_0095: ldarg.0
IL_0096: call instance class SyncCameraOrthoSettings CameraControl::get_OrthoSettings()
IL_009b: ldloc.1
IL_009c: callvirt instance void SyncCameraOrthoSettings::SetZoomLevelDelta(float32)
IL_00a1: ldarg.0
IL_00a2: call instance void CameraControl::ResetAtEdges()
IL_00a7: ldc.i4 0x143
IL_00ac: ldc.i4.1
IL_00ad: call bool GameInput::GetDoublePressed(valuetype [UnityEngine]UnityEngine.KeyCode,
bool)
IL_00b2: brfalse IL_0111
IL_00b7: call bool UINoClick::get_MouseOverUI()
IL_00bc: brtrue IL_0111
// BEGIN MOD
ldsfld class [UnityEngine]UnityEngine.GameObject GameCursor::UiObjectUnderCursor
call bool [UnityEngine]UnityEngine.Object::op_Implicit(class [UnityEngine]UnityEngine.Object)
brtrue IL_0111
// END MOD
*/
private void /* UIPartyPortraitBar:: */ Update()
{
//...
// BEGIN MOD
int num4 = (i + 1) % 10;
// END MOD
if (GameInput.GetDoublePressed((KeyCode) (0x30 + num4), true) || GameInput.GetDoublePressed((KeyCode) (0x100 + num4), true))
//...
if (num9 == -1)
{
// BEGIN MOD
num9 = 9;
// END MOD
}
}
/*
IL_01b3: ldloc.s V_7
IL_01b5: ldc.i4.1
IL_01b6: add
// BEGIN MOD
ldc.i4.s 10
rem
IL_01b7: stloc.s V_8
// IL_01b9: ldloc.s V_8
// IL_01bb: ldc.i4.s 10
// IL_01bd: ble IL_01c5
// IL_01c2: ldc.i4.0
// IL_01c3: stloc.s V_8
// END MOD
//...
IL_0298: ldloc.s V_15
IL_029a: ldc.i4.m1
IL_029b: bne.un IL_02a4
// BEGIN MOD
IL_02a0: ldc.i4.s 9
// END MOD
IL_02a2: stloc.s V_15
*/