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

One chest in NC cannot be opened #127

Merged
merged 3 commits into from Aug 10, 2021
Merged

One chest in NC cannot be opened #127

merged 3 commits into from Aug 10, 2021

Conversation

AmProsius
Copy link
Owner

@AmProsius AmProsius commented Jul 31, 2021

Describe the bug
Right next to the house of Buster there is a chest that cannot be opened/picked.

Expected behavior
The closed chest next to Buster's house can now be picked.

Additional context

[% oCMobContainer:oCMobInter:oCMOB:zCVob 64513 6384]
pack=int:0
presetName=string:OC_CHEST_MEDIUM_NC
bbox3DWS=rawFloat:-55190.5391 2919.41309 1100.78479 -55120.3203 2996.30811 1188.93396
trafoOSToWSRot=raw:2bd58e3d0000000068607f3f000000000000803f0000000068607fbf000000002bd58e3d
trafoOSToWSPos=vec3:-55158.1367 2919.41309 1144.36926
vobName=string:OC_CHEST_MEDIUM
visual=string:CHESTBIG_OCCHESTMEDIUMLOCKED.MDS
showVisual=bool:1
visualCamAlign=enum:0
cdStatic=bool:0
cdDyn=bool:1
staticVob=bool:1
dynShadow=enum:0
[visual zCModel 0 6385]
[]
[ai % 0 0]
[]
focusName=string:Chest
hitpoints=int:10
damage=int:0
moveable=bool:0
takeable=bool:0
focusOverride=bool:0
soundMaterial=enum:0
visualDestroyed=string:
owner=string:
ownerGuild=string:
isDestroyed=bool:0
stateNum=int:1
triggerTarget=string:
useWithItem=string:
conditionFunc=string:
onStateFunc=string:
rewind=bool:0
locked=bool:-1
keyInstance=string:LRL
pickLockStr=string:
contains=string:ItMiNugget:15,ItMi_Stuff_Plate_01,ItMi_Stuff_Cup_01,ItFoRice:3,ItFo_Potion_Water_01:2
[]

@szapp szapp added compatibility: easy type: revert on save type: world bug labels Feb 16, 2021
@AmProsius AmProsius added the validation: required label Feb 18, 2021
@AmProsius AmProsius added this to To Do in v1.1.0 Feb 24, 2021
@AmProsius AmProsius removed this from To Do in v1.1.0 Feb 24, 2021
@szapp szapp removed the type: revert on save label Mar 1, 2021
@szapp szapp added the impl: change obj var label Mar 17, 2021
@AmProsius
Copy link
Owner

@AmProsius AmProsius commented Mar 28, 2021

keyInstance=string:LRL
pickLockStr=string:

changed to

keyInstance=string:
pickLockStr=string:LRL

@AmProsius AmProsius added the provided fix label Mar 28, 2021
@szapp szapp added this to VOB property in Fix templates Mar 29, 2021
@szapp
Copy link
Collaborator

@szapp szapp commented Apr 22, 2021

I suggest to

  1. find the chest by its position -55158.1367, 2919.41309, 1144.36926 using G1CP_FindVobByPosF
  2. confirm the found VOB is a oCMobContainer object by using Hlp_Is_oCMobContainer
  3. assign it to a oCMobContainer variable, e.g. var oCMobContainer mob; mob = _^(vobPtr);
  4. check Hlp_StrCmp(mob._oCMobLockable_keyInstance, "LRL")
  5. check Hlp_StrCmp(mob._oCMobLockable_pickLockStr, "")

With these checks it should be confirmed that it is the correct chest and that the problem was not somehow fixed already. Then it is just about setting the properties.

On reverting, do essentially the same, but precede the checks with a check whether the G1CP fix was even applied (see other revertible fixes).

@AmProsius Do you think these kinds of hints are helpful and enough for you to write the fix?

@szapp szapp added this to the v1.2.0 milestone Apr 22, 2021
@szapp szapp added this to To Do in v1.2.0 via automation Apr 22, 2021
@AmProsius AmProsius self-assigned this Apr 23, 2021
@AmProsius AmProsius moved this from To Do to In Progress in v1.2.0 Jul 31, 2021
@AmProsius AmProsius requested a review from szapp Jul 31, 2021
@AmProsius AmProsius removed their assignment Jul 31, 2021
szapp
szapp approved these changes Aug 5, 2021
Copy link
Collaborator

@szapp szapp left a comment

I haven't run this test, but the code looks really good. I have a suggestion for improving the test (see comment below).

src/Ninja/G1CP/Content/Tests/test127.d Show resolved Hide resolved
@AmProsius AmProsius merged commit 0e552db into master Aug 10, 2021
v1.2.0 automation moved this from In Progress to Done Aug 10, 2021
@AmProsius AmProsius deleted the bug127 branch Aug 10, 2021
szapp added a commit that referenced this issue Jan 18, 2022
Finding VOBs by their exact position can now be further narrowed down by
their class. Like before only the first matching VOB will be found. The
function can now also detect light VOBs which where previously ignored.
For details, see the header commment of ent of 'G1CP_FindVobByPosPtr'.
Common class definitions are defined as constants in constants.d. All
affected fixes are updated.

Refs #46 #51 #52 #127 #212 #213 #226
szapp added a commit that referenced this issue Jan 19, 2022
Instead of specifying a class to narrow down the search (see previous
commit), the option is now more versatile: Now the last parameter is a
callback function. It can either be one of the existing class check
functions or a custom function to narrow down the search more flexibly
and potentially based on more or more complex checks.

Refs #46 #51 #52 #127 #212 #213 #226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility: easy impl: change obj var provided fix type: world bug validation: required
Projects
Fix templates
Change VOB property
v1.2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants