Jump to content

Dialogue Result - Moving NPC to different location


zelazko

Recommended Posts

 

 

PositionCell xPosition, yPosition, zPosition, direction, "CellID"

or example:

"Dabienne Mornardl"->PositionCell, -564, -61, 934, 0, "Rethan Manor"

Will make NPC move to given location when right dialogue is met.

 

 

 

 

I tried using

"NPCID"->PositionCell, 0, 400, 0, 0, "Valenvaryon, Propylon Chamber"

but this will just not work. However when I use without the ID it moves NPC to the location:

PositionCell, 0, 400, 0, 0, "Valenvaryon, Propylon Chamber"

Problem with

PositionCell, 0, 400, 0, 0, "Valenvaryon, Propylon Chamber"

I have is that it will move NPC instantly without displaying the dialogue. I tried to add Goodbye but it does not fix that.

Any code monkey knows better solution?

 

In my previous attempts I found that using PositionCell with the NPC ID worked as intended. But now it works halfway only and it was move to the same cell with same coordinates. :sleep:

 

Found workaround by making Choice function and adding only one choice. :D

 

Notes:
Using PositionCell in dialog results isn’t reliable, and may cause crashes: some users have no
problems with it, but for others it will crash the game, and for some users it may simply fail
unpredictably (this doesn't seem to be version-dependent, not sure what causes it). The way
Bethesda does this correctly is to use StartScript to start a script that does the teleporting.
(Forum Info/Emma).
You should not use this function on items that are in the players inventory, this causes MW to
crash (Forum info/Nigedo).
If you are repositioning the player immediately on detecting PC cell or CellChanged (e.g.
preventing teleport to a forbidden destination), you may need to introduce a delay of one or
two frames before using PositionCell to move the player back out of the cell, otherwise the
player may not end up at the correct coordinates. (Forum info / Monica21)

 

 

http://mw.modhistory.com/download-44-12396

 

I leave it for legacy for anyone googling may come in handy never know.

Edited by zelazko
Link to comment
Share on other sites

I had no problems with moving, but there is a limitation of the game engine.

You can only move the object into the cell where the player has been for the last 72 hours, otherwise there may be problems.

Therefore, I use a script that disables the object and moves it only when the player enters this cell.

Link to comment
Share on other sites

 

 

PositionCell xPosition, yPosition, zPosition, direction, "CellID"

or example:

"Dabienne Mornardl"->PositionCell, -564, -61, 934, 0, "Rethan Manor"

Will make NPC move to given location when right dialogue is met.

 

 

 

 

I tried using

"NPCID"->PositionCell, 0, 400, 0, 0, "Valenvaryon, Propylon Chamber"

but this will just not work. However when I use without the ID it moves NPC to the location:

PositionCell, 0, 400, 0, 0, "Valenvaryon, Propylon Chamber"

Problem with

PositionCell, 0, 400, 0, 0, "Valenvaryon, Propylon Chamber"

I have is that it will move NPC instantly without displaying the dialogue. I tried to add Goodbye but it does not fix that.

Any code monkey knows better solution?

 

In my previous attempts I found that using PositionCell with the NPC ID worked as intended. But now it works halfway only and it was move to the same cell with same coordinates. :sleep:

 

Found workaround by making Choice function and adding only one choice. :D

 

Notes:
Using PositionCell in dialog results isn’t reliable, and may cause crashes: some users have no
problems with it, but for others it will crash the game, and for some users it may simply fail
unpredictably (this doesn't seem to be version-dependent, not sure what causes it). The way
Bethesda does this correctly is to use StartScript to start a script that does the teleporting.
(Forum Info/Emma).
You should not use this function on items that are in the players inventory, this causes MW to
crash (Forum info/Nigedo).
If you are repositioning the player immediately on detecting PC cell or CellChanged (e.g.
preventing teleport to a forbidden destination), you may need to introduce a delay of one or
two frames before using PositionCell to move the player back out of the cell, otherwise the
player may not end up at the correct coordinates. (Forum info / Monica21)

 

 

http://mw.modhistory.com/download-44-12396

 

I leave it for legacy for anyone googling may come in handy never know.

I moved NPC to that cell using dialogue result and never have visited that cell before. NPC was there right after it got moved and and after waiting more 72 before entering that cell first time. OpenMW tested though.

Edited by zelazko
Link to comment
Share on other sites

This does not guarantee the absence of an error.


For example: the moveAhnassi script is fixed in PfP


Sometimes Ahnassi did not appear in her house.



When checking, I managed to get this error several times.


Then the error disappeared and I could not repeat it again.

What affects this is not known.




Link to comment
Share on other sites

I have my high hopes. It works on my savegame that numerously changed by adding and deleting mods. It works on new game too.

Users will prove it in the end if they will be interested enough to use the mod.

Edited by zelazko
Link to comment
Share on other sites

you can try

Goodbye

PositionCell

 

 

if it does not work, a safer alternative should be a global autostarted script

e.g.

 

Goodbye

StartScript myMoveScript

 

 

begin myMoveScript

 

if ( MenuMode )

return ; important to avoid possible crash using positioncell while still in dialog

endif

 

StopScript myMoveScript

PositionCell blah

 

end

 

 

[EDIT] I think the problem with original moveAhnassi script may be there are 2 calls to CellChanged in same frame

Edited by abot
Link to comment
Share on other sites

Problem I was encountering was because I used "NPC ID"-> where I should have just used without NPC ID given it was the same actor that was going to get teleported. Choice function to make dialogue split in two helps a lot with the delay so the NPC will not disappear while still in the dialogue mode.

 

 

you can try
Goodbye
PositionCell


if it does not work, a safer alternative should be a global autostarted script
e.g.

Goodbye
StartScript myMoveScript


begin myMoveScript

if ( MenuMode )
return ; important to avoid possible crash using positioncell while still in dialog
endif

StopScript myMoveScript
PositionCell blah

end


[EDIT] I think the problem with original moveAhnassi script may be there are 2 calls to CellChanged in same frame

 

Abot you seem very knowledgeable is there way to trade items with NPC under

 AiFollow Player 

Also I couldn't find anywhere how to make NPC change its class via dialogue results or scripts.

 

 

I lost this bet against Morrowind engine:

"NPC ID"->Setclass "Guard"

I got the feeling maybe I get lucky with this command. :D

Edited by zelazko
Link to comment
Share on other sites

> is there way to trade items with NPC under AIFollow

IIRC you need to change sCompanionShare Tribunal GMST from Share to Companion Share

so the dialog topic can work

(see mods like Cortex's Vampire Embrace as example)

 

> Also I couldn't find anywhere how to make NPC change its class via dialogue results or scripts

I don't think it is possible with standard scripting, maybe you could ask Nullcascade to add it to MWSE-Lua but you would probably have to calculate skills and other adjustments, similar to changing NPC level

 

 

> StopScript - will not give the second call

 

if you mean 2nd line below (positioncell) will not be executed?

StopScript myMoveScript

PositionCell blah

 

I think all script lines until return or end should be still executed in current frame

Edited by abot
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...