OpenMW scripting overhaul testing (existing functions)

Post » Tue Jun 09, 2015 10:09 pm

this gonna be incremental :P
can be moved to construction set if more fitting.
novice scripter so this seems to go way over the head fast but advice much appreciated.
will be spending praphic related bugs still osg is better up and running
got this somehow running and link for versions. makes aatest named interior cell. might need overhaul later on
https://www.dropbox.com/s/a5skbr2o7goabpc/aatest.esp?dl=0
basically need some structure and i think taking it from there and making rooms for different function groups something activated or distance / global trickered first giving message confirmation if all works.
one way would be from global giving kinda sure go for testing ground but don't know yet how.
ideas for something suitable ? in osg port if rotate works good could do dwewer mechanical tablet with rotating indicators
http://www.uesp.net/wiki/Tes3Mod:Categorical_Function_List
for script naming keeping searching easy something like rte_ in start of the script and onactivate, getdistance, onequip, etc. for testable function. var for variables and sh=short, lo=long, fl=float then those are needed for particular route.
for syntax conventions what could be best way to go .?
this has been the most debate but still now have bumped into next ones
1. for the get, set functions "player" goes same as player as in several other functions
2. if there extra functions commonly used and such the base behaviour is handle warning for it
3. for 2 there is possibility that it inheretly reduced possibility but later if it's still later on cs it can be expanded by marks like %... % or [], {}, (), "", take inside the proper function. morrowind script mostly takes only single variable so it's kinda save. will see..... any thoughts, more use cases in mind .?
4. conditions are read generally inside paranthese
5.
some structure:
- getbuttonpressed
1) with messagebox ignoring other script functions? https://bugs.openmw.org/issues/917
- enablestatreviewmenu
1) in vanilla read values directly from played game, buggy popping up all the inventorywindows
in
- centeroncell, coc
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://bugs.openmw.org/issues/2629
Spoiler
begin teleportdeathfloat timer ;this should cycle trought seyda neen and rethan manor still player is dead from bug;requires that next line and script is run as every frame global set timer to (timer + getsecondspassed)if (getpccell "rethan manor" == 1)    if (timer > 10 )          player -> position -11500 -67800 300000 0     set timer to 0     endifendifif (getpccell "seyda neen" == 1)    if (timer > 10)      coc "rethan manor"     set timer to 0    endifendif       endbegin teleportdeath1float timer ;for vanilla test case soltheim is better usedset timer to (timer + getsecondspassed)if (getpccell "rethan manor" == 1)    if (timer > 10 )          player -> positioncell 100 100 0 0 "solstheim"      set timer to 0     endifendifif (getpccell "solstheim" == 1)    if (timer > 10)      coc "rethan manor"     set timer to 0    endifendif       end
- position
1) consoling player -> position 0 0 32000 0 works in openmw failsafing to 0 0 ground if underground.
and in vanilla in console takes only x,y,zrot values and
places on ground (position -1000 -70000 anyvalue 0 teleport near seyda neen at the z height of 1000)
there is height limit atm thought.
300 000 000 height is possible but results in mesh clipping due to world origin distance
------> bug for not defaulting to ground when underground, before that test for objects + actors
-positioncell
- messagebox
in msfd 9 there's section for messagebox and variables can be taken with % mark. already script defined can be taken with %.ab
where
a= number of digits displayed, works for only f, others are ignored
b= ... for testing if the last designated value in script
1) in original help D for short, game works with g wiki: "-32,768 to 32,767"
2) in original f for float, works in game. wiki: "3.4e+38 to 3.4e-38" "7 digit precision"
3) in game G for long wiki: "-2,147,483,648 to 2,147,483,647"
4) in original S for string, not implemented
5) is there cases where type is important? can't be done in vanilla cs but then it would good to read variable directly for multiple inside same message and decide type based on script / leave the original designations in place?
begin messageboxshort afloat blong cset a to random set b to (b+getsecondspassed)set c to -2000000000if (onactivate==1)    messagebox "??
-random
. 1) before bloodmoon patch unreliable on small numbers. in openmw c++ generators
. 2) should work with operators if(random 20 == 10)
----------------------------------------------------------------------------
all testing is done with vanilla content + testing mod for reference.
possibly cross references scripting systems more like after this and in bugs.
begin onactivateif (onactivate ==1)    messagebox "if (onactivate ==1)"endifend
works in vanilla and openmw. related to https://bugs.openmw.org/issues/999
begin getdistanceplayerif (getdistance player < 100)   messagebox "getdistance player < 100"endifend
begin enablestatreviewmenuif (onactivate==1)      enablestatreviewmenuendifend
msfd 9 on the table
test scripts, structures are more than welcome : )
also advice on formatting.

this gonna be public document so would be using some of msfd testing scripts ok?
kinda lot modified of course to take openmw into account.
User avatar
Katie Samuel
 
Posts: 3384
Joined: Tue Oct 10, 2006 5:20 am

Return to III - Morrowind