Support for running, installing or compiling OpenMW
Before you submit a bug report for the first time, please read:
Bug reporting guidelines
ImpendingDoom
Posts: 1 Joined: 08 Aug 2017, 04:36
Post
by ImpendingDoom » 08 Aug 2017, 05:11
While trying to fix some of the issues with the various sailable ship mods (Fishing Academy, Stormrider, etc.) I ran into an issue with how OpenMW appears to handle the 'GetPCRunning' function. It
appears that while vanilla Morrowind takes this as a command to check if the player is actually running, OpenMW just checks if run mode is active (ie. shift/capslock is pressed). This manifests itself in the script governing plyer control over the ship - when pressing W while in run mode, boats and ships immediately shoot up to maximum speed instead of gradually incrementing up with each keypress.
The offending segment of code is here:
Spoiler: Show Code: Select all
;-------------------------------------------------------------------------------------------------------------------------------------------------------------
; Speed Control
;-------------------------------------------------------------------------------------------------------------------------------------------------------------
if ( sailmode == 1 )
if ( GetPCRunning == 1 )
if ( ScriptRunning, "bmultiplier_script02" == 0 )
startscript "bmultiplier_script02"
endif
endif
endif
if ( sailmode == 1 )
if ( GetPCRunning == 1 )
if ( bgear == 1 )
if ( sspeed < 20 ) ; max speed can be adjusted here ( default = 20 )
set sspeed to ( sspeed + 1 )
if ( gps == 0 )
set fishtype to 0
endif
if ( sspeed > 20 )
set sspeed to 20
endif
messagebox "Boat Speed : %.0f", sspeed
else
messagebox "Boat Speed : %.0f ( max. )", sspeed
endif
elseif ( bgear == 2 )
if ( bauto == 0 )
if ( sspeed != 0 )
rotate, z, -60
set oangle to getAngle, z
if ( oangle >= 0 )
set boatangle to ( oangle - 180 )
else
set boatangle to ( 180 + oangle )
endif
endif
endif
elseif ( bgear == 3 )
if ( bauto == 0 )
if ( sspeed != 0 )
rotate, z, 60
set oangle to getAngle, z
if ( oangle >= 0 )
set boatangle to ( oangle - 180 )
else
set boatangle to ( 180 + oangle )
endif
endif
endif
elseif ( bgear == 4 )
if ( sspeed > 0 ) ; min speed can be adjusted here ( default = 0 )
set sspeed to ( sspeed - 1 )
messagebox "Boat Speed : %.0f", sspeed
else
set sspeed to 0
messagebox "Boat Speed : 0 ( Stopped )"
endif
endif
else
stopscript "bmultiplier_script02"
endif
endif
akortunov
Posts: 900 Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation
Post
by akortunov » 08 Aug 2017, 07:09
GetPCRunning indeed checks only run mode in OpenMW:
Code: Select all
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld ()->getPlayerPtr();
runtime.push (ptr.getClass().getCreatureStats(ptr).getStance(MWMechanics::CreatureStats::Stance_Run));
GetPCSneaking behaves in the same way.
Can you investigate how these functions behave in vanilla Morrowind?
If there is a difference between OpenMW and Morrowind, feel free to create a bugreport.