Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/more externals #302

Merged
merged 21 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
237d679
fix(SoundCreator): Create empty audio clip if wavFile is empty
JucanAndreiDaniel Jan 29, 2024
5374282
improvment(AbstractProperties): make custom gameobject available from…
JucanAndreiDaniel Jan 29, 2024
edf2da6
add(Hero): Adds a static class Hero to handle common functions
JucanAndreiDaniel Jan 29, 2024
911f04a
add(VobProperties): Create children of VobProperties
JucanAndreiDaniel Jan 29, 2024
37fec38
More Externals Added:
JucanAndreiDaniel Jan 29, 2024
7ac2c99
fix(WaynetHelper): check if endWaypoint is null
JucanAndreiDaniel Jan 29, 2024
c538ddc
fix(GoToWp): Props.CurrentWaypoint might be null and destination migh…
JucanAndreiDaniel Jan 29, 2024
b9409a8
More Externals Added:ExtNpcClearAiQueue ExtNpcClearInventory ExtNpcGe…
JucanAndreiDaniel Jan 29, 2024
0d61618
fix(AiHandler): Fix loop state logic
JucanAndreiDaniel Jan 29, 2024
3235e15
More Externals Added:
JucanAndreiDaniel Jan 29, 2024
07aa760
candy(Externals): Improved log message and changed AbstractProperties…
JaXt0r Jan 29, 2024
acf9c38
Address review comments
JucanAndreiDaniel Jan 30, 2024
d44cbd7
fix(HeroProperties): Set the lookupCache object when requested first …
JaXt0r Jan 30, 2024
f9fce70
fix(ControllerManager): Null check before disabling buttonActions.
JaXt0r Jan 30, 2024
e10e600
fix(AiHandler): duplicate ZS_Start() execution and non-int return han…
JaXt0r Jan 30, 2024
929ddd6
cleanup(HeroVoice): Removed HeroVoice GO from VRPlayer as no longer n…
JaXt0r Jan 30, 2024
021fcd0
fix(ControllerManager): Initialize controller manager in awake
JucanAndreiDaniel Jan 30, 2024
c165efa
fix(AbstractProperties): Remove custom gameobject
JucanAndreiDaniel Jan 30, 2024
bf4c71f
Set Spatial Blending to 0 and volume to max for hero voice
JucanAndreiDaniel Jan 30, 2024
7910aca
Clean up a bit GoToWp.cs
JucanAndreiDaniel Feb 1, 2024
b82d178
Add FIXME comment to ExtNpcGetTalentSkill in NpcHelper.cs
JucanAndreiDaniel Feb 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6188,6 +6188,7 @@ GameObject:
- component: {fileID: 3286136461781483593}
- component: {fileID: 3490461415993468589}
- component: {fileID: 5331787116829108395}
- component: {fileID: 2500770934419847238}
m_Layer: 7
m_Name: VRPlayer
m_TagString: Player
Expand Down Expand Up @@ -6406,6 +6407,44 @@ CapsuleCollider:
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &2500770934419847238
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3286136461781483594}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da21e4a06ee346319b0a6dc74e0dcc61, type: 3}
m_Name:
m_EditorClassIdentifier:
npcSound: {fileID: 0}
bip01: {fileID: 0}
colliderRootMotion: {fileID: 0}
head: {fileID: 0}
headMorph: {fileID: 0}
mdmName:
baseMdsName:
overlayMdsName:
perceptionTime: 0
walkMode: 0
bodyState: 0
currentInteractable: {fileID: 0}
currentInteractableSlot: {fileID: 0}
currentInteractableStateId: -1
prevStateStart: 0
stateStart: 0
stateLoop: 0
stateEnd: 0
isStateTimeActive: 0
stateTime: 0
currentLoopState: 0
hasItemEquipped: 0
currentItem: 0
usedItemSlot:
itemAnimationState: -1
isClonedFromAnother: 0
--- !u!1 &3286136462172449750
GameObject:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GameObject:
- component: {fileID: 2022050282646122291}
- component: {fileID: 5252305678164495226}
m_Layer: 0
m_Name: Interactable
m_Name: Vob
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -44,5 +44,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 024fa582612e45c0afcf4ba9d756341e, type: 3}
m_Name:
m_EditorClassIdentifier:
<visual>k__BackingField:
<visualScheme>k__BackingField:
47 changes: 47 additions & 0 deletions Assets/GothicVR/Resources/Prefabs/Vobs/oCMobContainer.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6503575194566409312
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2022050282646122291}
- component: {fileID: 6383736313796596418}
m_Layer: 0
m_Name: oCMobContainer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2022050282646122291
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6503575194566409312}
serializedVersion: 2
m_LocalRotation: {x: 0.69465834, y: 0, z: 0, w: 0.71933985}
m_LocalPosition: {x: -328.3223, y: 27.197954, z: -177.9182}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 88, y: 0, z: 0}
--- !u!114 &6383736313796596418
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6503575194566409312}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3647fae04a904a6dbba443f755b63a7d, type: 3}
m_Name:
m_EditorClassIdentifier:
<visualScheme>k__BackingField:

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions Assets/GothicVR/Resources/Prefabs/Vobs/oCMobDoor.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6503575194566409312
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2022050282646122291}
- component: {fileID: 2607151182155886275}
m_Layer: 0
m_Name: oCMobDoor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2022050282646122291
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6503575194566409312}
serializedVersion: 2
m_LocalRotation: {x: 0.69465834, y: 0, z: 0, w: 0.71933985}
m_LocalPosition: {x: -328.3223, y: 27.197954, z: -177.9182}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 88, y: 0, z: 0}
--- !u!114 &2607151182155886275
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6503575194566409312}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aa8549f9b79448e4b3ebd6901ded3136, type: 3}
m_Name:
m_EditorClassIdentifier:
<visualScheme>k__BackingField:
7 changes: 7 additions & 0 deletions Assets/GothicVR/Resources/Prefabs/Vobs/oCMobDoor.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions Assets/GothicVR/Resources/Prefabs/Vobs/oCMobInter.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6503575194566409312
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2022050282646122291}
- component: {fileID: 862177027832733350}
m_Layer: 0
m_Name: oCMobInter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2022050282646122291
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6503575194566409312}
serializedVersion: 2
m_LocalRotation: {x: 0.69465834, y: 0, z: 0, w: 0.71933985}
m_LocalPosition: {x: -328.3223, y: 27.197954, z: -177.9182}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 88, y: 0, z: 0}
--- !u!114 &862177027832733350
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6503575194566409312}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fcee438f16834e5f8768391122403ab5, type: 3}
m_Name:
m_EditorClassIdentifier:
<visualScheme>k__BackingField:
7 changes: 7 additions & 0 deletions Assets/GothicVR/Resources/Prefabs/Vobs/oCMobInter.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions Assets/GothicVR/Resources/Prefabs/Vobs/oCMobMovable.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6503575194566409312
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2022050282646122291}
- component: {fileID: 1223192878683548434}
m_Layer: 0
m_Name: oCMobMovable
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2022050282646122291
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6503575194566409312}
serializedVersion: 2
m_LocalRotation: {x: 0.69465834, y: 0, z: 0, w: 0.71933985}
m_LocalPosition: {x: -328.3223, y: 27.197954, z: -177.9182}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 88, y: 0, z: 0}
--- !u!114 &1223192878683548434
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6503575194566409312}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a183092aa29e4a39b4c79965145291c3, type: 3}
m_Name:
m_EditorClassIdentifier:
<visualScheme>k__BackingField:

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Assets/GothicVR/Resources/Prefabs/Vobs/zCVobSpot.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 13f4f324c4e84a1b8d8427d29f1d2deb, type: 3}
m_Name:
m_EditorClassIdentifier:
<visual>k__BackingField:
<visualScheme>k__BackingField:
fp:
Name:
Position: {x: 0, y: 0, z: 0}
IsLocked: 0
--- !u!33 &4250102412515220408
MeshFilter:
m_ObjectHideFlags: 0
Expand Down
10 changes: 9 additions & 1 deletion Assets/GothicVR/Scripts/Caches/PrefabCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ public enum PrefabType
{
Npc,
WayPoint,
Vob,
VobItem,
VobContainer,
VobDoor,
VobInteractable,
VobMovable,
VobSpot,
VobPfx,
VobMusic,
Expand All @@ -29,8 +33,12 @@ private static string GetPath(PrefabType type)
{
PrefabType.Npc => "Prefabs/Npc",
PrefabType.WayPoint => "Prefabs/WayPoint",
PrefabType.Vob => "Prefabs/Vobs/Vob",
PrefabType.VobItem => "Prefabs/Vobs/oCItem",
PrefabType.VobInteractable => "Prefabs/Vobs/Interactable",
PrefabType.VobContainer => "Prefabs/Vobs/oCMobContainer",
PrefabType.VobDoor => "Prefabs/Vobs/oCMobDoor",
PrefabType.VobInteractable => "Prefabs/Vobs/oCMobInter",
PrefabType.VobMovable => "Prefabs/Vobs/oCMobMovable",
PrefabType.VobSpot => "Prefabs/Vobs/zCVobSpot",
PrefabType.VobPfx => "Prefabs/Vobs/vobPfx",
PrefabType.VobMusic => "Prefabs/Vobs/oCZoneMusic",
Expand Down
14 changes: 13 additions & 1 deletion Assets/GothicVR/Scripts/Creator/NpcCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private static NpcProperties GetProperties(NpcInstance npc)

private static GameObject GetNpcGo(NpcInstance npcInstance)
{
return GetProperties(npcInstance).gameObject;
return GetProperties(npcInstance).go;
}

/// <summary>
Expand Down Expand Up @@ -222,10 +222,22 @@ public static NpcInstance ExtHlpGetNpc(int instanceId)
return properties.npcInstance;
}

public static int ExtHlpGetInstanceId(DaedalusInstance instance)
{
if (instance == null)
return -1;
return instance.Index;
}

public static void ExtNpcPerceptionEnable(NpcInstance npc, VmGothicEnums.PerceptionType perception, int function)
{
var props = GetProperties(npc);
props.Perceptions[perception] = function;
}
public static void ExtNpcPerceptionDisable(NpcInstance npc, VmGothicEnums.PerceptionType perception)
{
var props = GetProperties(npc);
props.Perceptions[perception] = -1;
}

public static void ExtNpcSetPerceptionTime(NpcInstance npc, float time)
Expand Down
18 changes: 15 additions & 3 deletions Assets/GothicVR/Scripts/Creator/Sounds/SoundCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,21 @@ public static SoundData GetSoundArrayFromVfs(string name)

public static AudioClip ToAudioClip(SoundData wavFile)
{
var audioClip =
AudioClip.Create("Sound", wavFile.sound.Length/wavFile.channels, wavFile.channels, wavFile.sampleRate, false);
audioClip.SetData(wavFile.sound, 0);
AudioClip audioClip;

try
{
audioClip =
AudioClip.Create("Sound", wavFile.sound.Length / wavFile.channels, wavFile.channels,
wavFile.sampleRate, false);
audioClip.SetData(wavFile.sound, 0);
}
catch (Exception e)
{
Debug.LogError(e);
audioClip = AudioClip.Create("Sound", 1, 1, 44100, false);
audioClip.SetData(new float[] { 0 }, 0); // almost empty audio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why setting an empty one instead of stopping the clip creation fully?
Please also name an example of a file which isn't loadable.

}

return audioClip;
}
Expand Down
Loading