scripting overhaul testing

Feedback on past, current, and future development.
Post Reply
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

scripting overhaul testing

Post by sjek »

Another round. Awesome coomunity btw.

MWSE is developed kinda heavily http://forums.bethsoft.com/topic/152794 ... er-mwse-2/
Also newer MWSE 2.0 rewrite https://mwse.readthedocs.io/en/latest/l ... ction.html

This is gonna be incremental :P

This esp makes interior cell named aatest. will need overhaul later on.
https://www.dropbox.com/s/a5skbr2o7goab ... t.esp?dl=0
To bypass vanilla file corruption, done in openmw-cs.

Basically needs some structure and need to make rooms for different function groups.
Something activated or distance / global trickered, giving message confirmation if all works.
ideas welcome for something suitable.
  1. http://www.uesp.net/wiki/Tes3Mod:Catego ... ction_List
  2. http://www.uesp.net/morrow/editor/mw_cscommands.shtml
  3. http://wiki.theassimilationlab.com/mmw/ ... or_Dummies
  4. msfd 9
  5. http://mwmodders.com/scriptingnotes.html
  6. https://www.tamriel-rebuilt.org/content ... ng-dummies
Lua was decided to be newscript.
This has been the most debated.
Better documentation in zini's design doc for needed features.
viewtopic.php?f=20&t=5256
  1. sys::
  2. script hooks
Scripting rules from Scripting_for_Dummies in vanilla
  1. inconsistent use of commas can lead to compile errors.
  2. "If the ID contains a space or begins with an underscore, you must use quotation marks"
  3. leave a space around parantheses and operators. can cause problems otherwise.
  4. "a x"-> works but "a x" -> not always like x ->, don't use spaces should work
Safegame corruption crashes in vanilla:
  1. Loading savegame with outdated modinfo + secondly loading second save with recent info,
    seems to notice commas and letters in script, but not numbers
---------------------------------------------------------------------------
getbuttonpressed

Code: Select all

   
   1)  Gets the messagebox result starting from 0 for first button 
         and returns otherwise -1 when messagebox is not open, 
         https://gitlab.com/OpenMW/openmw/issues/917
       
results:
  1. Getbuttonpressed without linked messagebox is supposed to scan messagebox from any script, so any choise as its itself in script is overglowing by design.
  2. This causes blocking the referred free floating? result on other local scripts.
  3. Getting getbuttonpressed from messagebox needs mechanism to wait one frame for the info to be processed and useful.
  4. ie. OnActivate can't be 1 on the same frame as GetButtonPressed is not -1 (from capo)
  5. Menumode check can be used prevent script execution while in menus ie. activated container, etc.
For above mentioned reasons and one eluded, structure needs to be exactly same as in http://wiki.theassimilationlab.com/mmw/ ... e_executed

Namely with onactivate:

Code: Select all

short button
short tag

if ( onactivate == 1 )
	if tag == 0
    	messagebox "resharge" "ok then dear" "almsivi allmighty"
		set tag to 1
	endif
endif
	
if tag == 1
	set button to getbuttonpressed
	if ( button == 0 )
		player->additem "repair_journeyman_01" 1
		set tag to 0
	endif
	if ( button == 1 )
		player->additem "p_restore_fatigue_q" 1
		set tag to 0
	endif
endif
Otherwise multiple messageboxes in same cell doesn't work as intented
and it's mess https://gitlab.com/OpenMW/openmw/issues/2676
---------------------------------------------------------------------------
messagebox
Spoiler: Show
tests:
Spoiler: Show
---------------------------------------------------------------------------
enablestatreviewmenu

theory

Code: Select all

    1) in vanilla read values directly from played game, buggy, popping up all the inventorywindows.
          	in openmw same, unbuggy https://github.com/OpenMW/openmw/pull/1257
Spoiler: Show
---------------------------------------------------------------------------
disable / delete

Code: Select all

    1) in vanilla disable removes the target from the world but set delete only partially works, calling functions working
        before cell reload
    2) openmw disable removes target from renders and collision and set delete is straightforward deleting.
---------------------------------------------------------------------------
centeroncell, coc

Code: Select all

1) in vanilla player damage seems to be calculated from end position while in openmw there is a bug causing the start
    position come into account https://gitlab.com/OpenMW/openmw/issues/2629 (fixed)
tests:
Spoiler: Show
---------------------------------------------------------------------------
position x y z zrot

Code: Select all

    1) consoling player -> position 0 0 32000 0 works in openmw 
       failsafes to 0 0 ground if underground.
       300 000 000 height is possible but results in mesh clipping due to world origin distance
       
       in vanilla, console takes only x,y,zrot values and defaults on ground 
       position -1000 -70000 (any value) 0         teleports as  intended near seyda neen but at the z height of 1000 
       
       test: defaulting to ground on actors, statics
test for variables: works
Spoiler: Show
---------------------------------------------------------------------------
positioncell



---------------------------------------------------------------------------
GetPCTraveling and GetPCInJail

both returns 0 in one frame after new cell is loaded
https://github.com/OpenMW/openmw/pull/1868

testing script by LennyPenny
https://upl.io/i/4ct8te.mp4
Spoiler: Show
---------------------------------------------------------------------------
startcombat, stopcombat

use cases
  1. targeting file placed references
  2. console placed references (doesn't work in vanilla)
  3. script placed references
  4. unigue references from base game
  5. local script
  6. global script
  7. dialogue results
  8. interaction with setfight
Spoiler: Show
---------------------------------------------------------------------------
random

Code: Select all

   1) before bloodmoon patch unreliable on small numbers. in openmw c++ generators
   2) in vanilla seems to fire about 20 times a frame while in openmw once every frame
   3) should work with operators  if ( random 20 == 10 )  
test:
Spoiler: Show
---------------------------------------------------------------------------
for scripts + testing mods
possibly cross referencing scripting systems in the future
Spoiler: Show
related to https://gitlab.com/OpenMW/openmw/issues/999

ungategorized scripts:
Spoiler: Show
msfd 9 on the table
test scripts, structures are more than welcome : )
also advice on formatting.
Spoiler: Show
Documentation also partially in here https://github.com/sjek/scripts-workspace
Last edited by sjek on 12 Jan 2019, 09:08, edited 86 times in total.
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: scripting overhaul testing

Post by sjek »

Spoiler: Show
edit: placing here some of written scripts, these may be complicated or simple, most using probably feature(s) not possibly in vanilla.
copyright is CC0 ie. free to use, mod, share or whatever pops into mind


Spinning quest hindering player control relative to eldafire's movement, including fargoth as a sidekick:
---------------------------------------------------------------------------------------------
This can be extended with dialogue kinda simply by targeting script variables.
Eldafire is basically moving across ridge from side to side, which make fargoth disappear in one direction and affects direction of the player's rotation on both. xP

There's three scripts from which
1. travelingtrigger makes eldafire walk the gridge back and forth
2. handlewitch deals with variable rotating speed of player when activator in question has been activated
3. spinningdist rotates fargoth in speed relative to distance to player after treshold
Spoiler: Show
Hrisskar in arrille tradehouse says things while in specific distance or sees you and scripted related effect with randomised outcome
----------------------------------------------------------------------------------------------
this works in openmw (say function in dialogue works, while not bugfree in vanilla) and for the health reduce, the else is triggered, if getlos player isn't 0 and rand > 99, bypassing both if clauses before else.

kills player kinda quickly with random < 50 and modhealth -10
(note: modhealth can't be seen unless in inventory as it's affects maxhealth)
diminishing hp while speaking need modhealth inside saydone
Spoiler: Show
Spinning object, caster, while turns angles (unique gold ganet)
-------------------------------------------------------------------------------
Ability to shoot the player with fireball once in a turn. shooting more fireballs than one may be possibly with high framerate, angles over 290 registering multiple times, but it turns on the same value so it's might need to be pretty high.

Uses openmw ability for activators casting targeted spells.
This could also be used to make part of dialogue or event triggered maze, as changing script variables from dialogue, ie other than script is intended to work in openmw bugfree.
Spoiler: Show
-------------------------------------------------------------------------
Last edited by sjek on 15 Oct 2018, 15:37, edited 24 times in total.
Post Reply