Thomas
085fb2c5a2
Simplified documentation a bit
2014-05-13 14:13:05 -04:00
Thomas
a61d804de6
now that I've found the documentation, fixed some stuff for extensions
2014-05-13 13:53:06 -04:00
Thomas
8f90dd43ec
Changed things to use typedef ScriptARgs/ScriptReturn, which makes finding out what those weird strings meant much much easier
2014-04-29 12:52:08 -04:00
Thomas
c2127845af
Added onKnockdown command
2014-04-27 20:54:22 -04:00
scrawl
f921f2e7db
Make PcRaiseRank, PcLowerRank and PcJoinFaction properly accept references instead of using the actor that the player talked to last.
...
This also solves a potential crash when no actor has been talked to yet, e.g. immediately after loading a savegame.
2014-04-26 12:04:37 +02:00
scrawl
452b522bc3
Fix typos
2014-03-22 19:01:41 +01:00
scrawl
c8c0e5de38
Fixed code issues found with unity build. Missing include guards, duplicated functions, ...
2014-03-16 23:49:06 +01:00
Marc Zinnschlag
0d84adb2c6
allow x->(y) instead of (x->y)
2014-02-15 12:50:40 +01:00
Marc Zinnschlag
fd665a1994
ignore conditions after an else (only works if condition is put in parentheses)
2014-02-15 12:45:50 +01:00
Marc Zinnschlag
d213c6c36a
fixed a constness-issue
2014-02-14 12:23:00 +01:00
Marc Zinnschlag
451e1f413b
instead of using pre-compiled variable lists for remote member access get the variable list from the remote script on the fly
2014-02-14 11:15:16 +01:00
Marc Zinnschlag
e76ef92669
also allow the use of keywords as remote local variables in set statements
2014-02-14 09:06:06 +01:00
Marc Zinnschlag
2086ebe410
fix for inappropriate disable (2nd attempt)
2014-02-14 08:48:26 +01:00
Marc Zinnschlag
b01c6dad37
Revert "allow disable as an alias for getDisabled (in most cases)"
...
This reverts commit f7ff4fbd51
.
2014-02-14 08:29:18 +01:00
Marc Zinnschlag
f7ff4fbd51
allow disable as an alias for getDisabled (in most cases)
2014-02-13 15:31:07 +01:00
Marc Zinnschlag
d6e212a02b
Merge branch 'master' into script
2014-02-13 15:02:02 +01:00
Marc Zinnschlag
309573a3ac
allow the use of the keyword end as a variable name in an expression
2014-02-13 14:15:48 +01:00
Marc Zinnschlag
ac8290c4d3
fixed problem with line endings in case of a local variable redeclaration
2014-02-13 09:59:22 +01:00
Marc Zinnschlag
dde4fbd818
allow one more integer argument in RemoveSoulGem and up to 6 more in AiFollow and then throw them all away
2014-02-13 09:52:44 +01:00
Marc Zinnschlag
87b51e47a9
fixed another case issue in remote member access
2014-02-13 09:40:07 +01:00
Marc Zinnschlag
c03bd8ebb6
allow [] as aliases for ()
2014-02-13 08:59:33 +01:00
Marc Zinnschlag
0313876d88
allow leaving out if in a top-level if-statement
2014-02-13 08:49:40 +01:00
Marc Zinnschlag
2eeb0eb4f3
allow lines to continue with other instructions after an legit else
2014-02-13 08:38:26 +01:00
Marc Zinnschlag
749136bf33
ignore attempts to set non-existing variables
2014-02-12 20:23:47 +01:00
Marc Zinnschlag
a85d3c7dcb
ignore unused explicit references for functions
2014-02-12 13:53:59 +01:00
Marc Zinnschlag
6e2e4d1adf
ignore stray begin
2014-02-12 13:45:01 +01:00
Marc Zinnschlag
93d4743012
interpret instruction keywords as names within expressions
2014-02-12 09:56:25 +01:00
Marc Zinnschlag
c0a6acfe6c
allow the use of keywords as variable names in more places
2014-02-12 09:23:23 +01:00
Marc Zinnschlag
b1b0877122
allow additional numeric argument for AiFollow and ignore it
2014-02-12 09:14:32 +01:00
Marc Zinnschlag
bfb0e62c4a
ignore additional string argument after enable/disable
2014-02-12 09:10:05 +01:00
Marc Zinnschlag
61626e90da
allow additional string argument for stopcombat and addspell (ignored)
2014-02-12 08:53:37 +01:00
Marc Zinnschlag
6a5d88b640
ignore stray else and endif in scripts
2014-02-12 08:42:42 +01:00
Marc Zinnschlag
697bda6371
allow (and discard) explicit reference on instructions that do not accept explicit references
2014-02-11 14:55:31 +01:00
Marc Zinnschlag
f26aa4f645
fixed while loop implementation
2014-02-11 13:31:04 +01:00
Emanuel Guevel
8c8f4cd420
Fix typo
2014-02-10 22:53:16 +01:00
Marc Zinnschlag
5c0071f320
fixed spelling of an error message
2014-02-10 14:59:20 +01:00
Marc Zinnschlag
3b990795c4
added access to remote access of local variables of global scripts
2014-02-10 14:45:55 +01:00
Marc Zinnschlag
3147aebf75
factored out declaration parser
2014-02-10 13:01:52 +01:00
Marc Zinnschlag
2b2ac6f62b
allow declaration of local variables with keywords as names
2014-02-02 15:43:48 +01:00
Marc Zinnschlag
32860a05e3
added dummy implementations for getPcInJail and getPcTraveling
2014-02-02 15:35:18 +01:00
Marc Zinnschlag
914ab1b8ab
allow 'x' instead of 'getjournalindex x'
2014-02-02 15:08:27 +01:00
Marc Zinnschlag
cd9b137129
allow elseif without matching if (grrrrr)
2014-02-02 14:24:58 +01:00
Marc Zinnschlag
8bcdf54570
added warning mode to script compiler error handler
2014-02-02 13:55:03 +01:00
scrawl
03cf383be7
Merge branch 'master' of https://github.com/zinnschlag/openmw into savedgame
...
Conflicts:
apps/openmw/mwgui/referenceinterface.cpp
apps/openmw/mwmechanics/actors.cpp
apps/openmw/mwmechanics/mechanicsmanagerimp.cpp
apps/openmw/mwmechanics/mechanicsmanagerimp.hpp
apps/openmw/mwscript/cellextensions.cpp
apps/openmw/mwworld/cells.cpp
apps/openmw/mwworld/cells.hpp
apps/openmw/mwworld/cellstore.cpp
apps/openmw/mwworld/store.cpp
apps/openmw/mwworld/worldimp.cpp
2014-01-24 18:28:35 +01:00
Marc Zinnschlag
3e58eb34e4
Merge remote-tracking branch 'sergeyshambir/startcombat'
...
Conflicts:
apps/openmw/mwscript/docs/vmformat.txt
2014-01-13 10:17:10 +01:00
scrawl
6f9113fe88
Add preliminary implementation of PayFine, PayFineThief and GoToJail instructions
2014-01-09 01:49:58 +01:00
scrawl
7b33f6f2ac
Detect crime of sleeping in other NPC's beds. ShowRestMenu needs to support an explicit/implicit reference for this.
2014-01-08 17:19:43 +01:00
Sergey Shambir
d5a0ff17fd
MWScript: updated vmformat.txt, changed opcodes to fix sequence.
...
Opcodes for StartCombat, StopCombat, GetTarget now follow the last
previous opcode.
2014-01-07 05:06:20 +04:00
Sergey Shambir
5c7e39a92f
Implemented script commands StartCombat, StopCombat, GetTarget.
...
Also renamed one field of AIWander class because it's not longer
unknown.
2014-01-07 04:43:06 +04:00
scrawl
62774fcc4a
Merge branch 'master' into HEAD
...
Conflicts:
apps/openmw/mwbase/world.hpp
apps/openmw/mwinput/inputmanagerimp.cpp
apps/openmw/mwmechanics/actors.cpp
apps/openmw/mwworld/worldimp.cpp
apps/openmw/mwworld/worldimp.hpp
components/esm/loadtes3.cpp
2014-01-06 00:23:17 +01:00
scrawl
b3764c504a
Implement GetPcJumping instruction
2014-01-05 19:08:12 +01:00
scrawl
2a7d610f87
Implement GetSpellReadied instruction
2014-01-03 22:55:17 +01:00
scrawl
55c5d7cee4
Implement Resurrect instruction
2014-01-03 15:54:23 +01:00
scrawl
b4230f716e
Implement RemoveEffects instruction
2014-01-03 05:19:10 +01:00
scrawl
7d8ca91286
Implement RemoveSpellEffects instruction
2014-01-03 05:18:44 +01:00
scrawl
366801f3d5
Implement explodeSpell instruction (like Cast, with caster = target)
2014-01-03 04:44:50 +01:00
scrawl
93e1a2df73
Implement Cast script instruction (shrines work now)
2014-01-03 04:09:52 +01:00
Lukasz Gromanowski
1ce4663065
Updated compiler opcodes for COE, and setHello.
...
Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
2013-12-31 18:13:38 +01:00
Lukasz Gromanowski
50b6e828cc
Added asserts in Interpreter::installSegmentX methods.
...
Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
2013-12-30 23:51:44 +01:00
Marc Zinnschlag
3590fa40bd
store global script state in saved game files
2013-12-15 16:16:50 +01:00
scrawl
9f5ff033d7
Handle the "GetLOS" alias for GetLineOfSight
2013-11-25 14:06:59 +01:00
scrawl
58dce88c7d
Handle the "tai" alias for ToggleAI
2013-11-25 14:03:51 +01:00
gus
dff3cf162d
ToggleAI script instruction
2013-11-18 23:03:44 +01:00
gus
d587f3c946
Merge branch 'master' of https://github.com/zinnschlag/openmw.git into AICombat
...
Conflicts:
apps/openmw/mwmechanics/actors.cpp
apps/openmw/mwscript/docs/vmformat.txt
2013-10-31 09:51:17 +01:00
Emanuel Guevel
496f786c2a
Implement Disable/EnableLevitation script functions
...
Totally copied on Disable/EnableTeleporting implementation.
Thanks KittyCat!
2013-10-02 15:33:20 +02:00
gus
46a734852b
adding script instruction getLOS + some test about AI
2013-09-10 16:16:13 +02:00
mckibbenta
8998b90e8b
initial do-nothing implementation; registered opcode
2013-08-24 21:19:12 -04:00
Chris Robinson
73437dfdca
GetEffect can accept an effect ID string as well
2013-08-13 19:18:21 -07:00
Chris Robinson
30973352e8
Implement ShowVars (SV) console function
2013-08-13 04:54:41 -07:00
Chris Robinson
db1036e5e5
Handle SetWerewolfAcrobatics
2013-08-09 05:37:56 -07:00
Chris Robinson
2bac4566c0
Merge remote-tracking branch 'PotatoesMaster/werewolf' into werewolf
...
Conflicts:
apps/openmw/mwmechanics/actors.cpp
apps/openmw/mwscript/statsextensions.cpp
2013-08-08 00:09:29 -07:00
Alex
b9579e085f
cleanup
2013-08-07 15:40:57 -04:00
Alex
c3ca5b7c32
mild cleanup
2013-08-07 13:16:20 -04:00
Alex
de1f423bd7
initial move of script opcodes and registerExtensions functions to components/compiler
2013-08-06 20:38:41 -04:00
scrawl
7dc30a01cd
Some changes suggested by cppcheck
2013-07-31 18:46:32 +02:00
Marc Zinnschlag
4a75c7dcc0
allow backticks in names
2013-07-07 16:09:26 +02:00
Marc Zinnschlag
a2aa3aaa0e
workaround for - in names
2013-06-21 14:20:52 +02:00
Miroslav Puda
7149439ace
Replacement of empty() method by assertion.
2013-05-22 13:23:49 +02:00
Miroslav Puda
d5689730eb
Removal of unnecessary variable.
...
empty variable duplicates empty() method of std::string. Check for empty value should be replaced by assert since it does not makes much sense to call scanInt with null character.
2013-05-18 22:57:27 +02:00
Marc Zinnschlag
e2620a1edf
Issue #694 : allow float literals starting with .
2013-05-13 11:38:35 +02:00
scrawl
f0354ea04c
Fix member variable case problem
2013-05-04 19:14:19 +02:00
Marc Zinnschlag
fe038cef03
turned redeclartion of local variables from an error into a warning
2013-05-01 14:20:09 +02:00
Marc Zinnschlag
63407a662c
allow <== and >== as alternative for <= and >= in scripts
2013-05-01 14:08:05 +02:00
Marc Zinnschlag
90b38cbfbe
fixed parsing of end statements in scripts with IDs matching keywords
2013-04-27 14:06:23 +02:00
Marc Zinnschlag
6d3a2cd5a0
added comment token (for use in syntax colouring)
2013-04-11 10:50:22 +02:00
Marc Zinnschlag
74145410f2
basic syntax highlighting in script subview
2013-04-10 22:49:22 +02:00
Marc Zinnschlag
fd0aa1a4b8
Issue #685 : Treat : as a whitespace
2013-03-31 14:46:46 +02:00
Marc Zinnschlag
4711135e7f
workaround for faulty endif in Morrowind scripts
2013-03-18 12:05:54 +01:00
Marc Zinnschlag
46bde604f9
Issue #601 : unary minus was interpreted as binary minus when used in an argument list without comma
2013-03-17 17:13:25 +01:00
Marc Zinnschlag
151ecaad04
workaround for garbage after an end statement
2013-02-25 10:32:38 +01:00
eduard
2dc0064cc2
more string lowercase
2013-01-09 20:51:52 +01:00
guidoj
0549e949ba
Mostly removal of unnecessary #include's and a little clean up
2012-07-17 09:27:12 +02:00
Marc Zinnschlag
50d81e99fb
possible fix for script execution bug
2012-06-19 14:55:22 +02:00
Marc Zinnschlag
fe85de5ea7
Issue #181 : assignment to member variables
2012-06-16 14:29:55 +02:00
Marc Zinnschlag
10b27e582b
Issue #181 : various fixed to member variable access
2012-06-16 13:51:13 +02:00
Marc Zinnschlag
8b19de17b6
Iisue #181 : enable member variable access from expressions in console
2012-06-16 13:21:01 +02:00
Marc Zinnschlag
6c5b21fa42
Issue #181 : Member variable access in expressions; error reporting fix for the previous commit
2012-06-16 13:06:23 +02:00
Marc Zinnschlag
d1441d79e7
Issue #181 : added code generation for member variable access
2012-06-16 10:49:34 +02:00
Marc Zinnschlag
050559d2e2
Issue #181 : added member variable access token
2012-06-16 10:31:49 +02:00
Marc Zinnschlag
6ec2a2091c
Issue #305 : Allow the use of = as a synonym for ==
2012-06-07 12:16:03 +02:00
scrawl
c85c794c86
fixed some cppcheck issues
2012-06-06 20:29:30 +02:00
Marc Zinnschlag
01500e979a
another fix for optional arguments
2012-04-05 15:00:49 +02:00
Marc Zinnschlag
d9677cb33e
fixed problem with parsing optional string arguments
2012-03-18 14:27:49 +01:00
Marc Zinnschlag
187b8e58d6
fixed handling of optional instruction/function arguments; removed choice workaround
2012-03-17 19:32:44 +01:00
Marc Zinnschlag
5b378e820d
warning level adjustments and some related fixes
2012-03-15 16:01:41 +01:00
Marc Zinnschlag
861dc6a16e
redirecting output of expression evalutation to new report channel
2011-04-26 22:07:27 +02:00
Marc Zinnschlag
6848115c18
backend for tab completion: keywords
2011-01-12 18:24:00 +01:00
Pieter van der Kloet
dd4d022301
Converted all tabs to four spaces
2011-01-05 22:18:21 +01:00
Marc Zinnschlag
044bf0ab48
fixed parsing explicit references in the body of control structures
2010-08-30 14:44:23 +02:00
Marc Zinnschlag
c18e83d7c0
extended scripting extensions to code segment 3 (instructions and functions with optional arguments)
2010-08-22 14:00:30 +02:00
Marc Zinnschlag
b3cc3073a3
changed encoding of segment 3 opcodes (increasing the number of opcodes, while reducing the width of the argument)
2010-08-22 13:15:56 +02:00
Marc Zinnschlag
f4e79a48f0
implemented optional arguments
2010-08-22 12:47:56 +02:00
Marc Zinnschlag
276a9db6f7
added missing button implementation for MessageBox
2010-08-22 11:14:14 +02:00
Marc Zinnschlag
0d4f2ab3ef
disabled escape sequences in script strings (doesn't work with Windows paths)
2010-08-12 19:41:40 +02:00
Marc Zinnschlag
cf7150e585
implemented naked expressions in lineparser (used in console; result is send through messagebox interface)
2010-07-21 13:34:52 +02:00
Marc Zinnschlag
01edd8deb5
compiler exception class fixes
2010-07-21 10:57:21 +02:00
Marc Zinnschlag
0f742ce7f9
even better error checking for extensions with explicit references
2010-07-10 12:31:00 +02:00
Marc Zinnschlag
211b723137
better error checking for extensions with explicit references
2010-07-10 12:16:45 +02:00
Marc Zinnschlag
71c710f9f6
enhanced compiler extenion system to support new instructions and functions with explicit references
2010-07-09 22:01:24 +02:00
Marc Zinnschlag
69e607e140
implemented getdistance with explicit references
2010-07-09 20:55:39 +02:00
Marc Zinnschlag
c37b007be0
added verification for explicit references (check if the given ID exists)
2010-07-09 20:35:34 +02:00
Marc Zinnschlag
d4ac3b506e
implemented enable, disable and getdisabled with explicit references
2010-07-09 19:32:17 +02:00
Marc Zinnschlag
5a1dd4fedd
fixed fileparser bug (empty line before the initial begin statement were not handled correctly
2010-07-09 18:21:16 +02:00
Marc Zinnschlag
592fa84e2d
added Enable, Disable, GetDisabled
2010-07-09 16:07:03 +02:00
Marc Zinnschlag
9d73718ec1
added GetSecondsPassed
2010-07-06 12:06:50 +02:00
Marc Zinnschlag
85cd744f44
fixed a stringparser bug
2010-07-05 13:33:17 +02:00
Marc Zinnschlag
b28a6fd7b8
modified parser to skip over button arguments in an messagebox instruction
2010-07-05 13:21:08 +02:00
Marc Zinnschlag
34b824cb70
implemented GetDistance function
2010-07-05 12:30:45 +02:00
Marc Zinnschlag
5786addab5
allowed the use of keywords as script names (*sigh*)
2010-07-05 10:58:10 +02:00
Marc Zinnschlag
a61b2c39f0
added scriptrunning/startscript/stopscript; sorted out more case problems
2010-07-04 16:00:32 +02:00
Marc Zinnschlag
185f8bd56d
added random function; global variable fix
2010-07-04 13:59:29 +02:00
Marc Zinnschlag
f9c1548f80
added menumode script function; added global variable handling in compiler and interpreter (openmw context still ignores global variables)
2010-07-04 12:29:28 +02:00
Marc Zinnschlag
5d46fc869c
added missing sound script functionality; various script-related bug-fixes
2010-07-03 20:35:59 +02:00
Marc Zinnschlag
32eafaa301
added custom function handling (compiler)
2010-07-03 10:43:55 +02:00
Marc Zinnschlag
a1beffc3cd
added compiler extensions class
2010-07-03 09:54:01 +02:00
athile
5825af45c3
Visual Studio 2010 compile fixes
2010-07-01 23:52:20 -07:00
athile
056194baa2
Merge upstream
2010-07-01 12:01:59 -07:00
Nicolay Korslund
d03a4c2c7c
Fixed a couple more line endings
2010-07-01 17:41:06 +02:00
Marc Zinnschlag
804aed6298
added basic message box formatting
2010-07-01 16:40:03 +02:00
Marc Zinnschlag
aeb41105c4
added comparison operators
2010-07-01 12:19:52 +02:00
Marc Zinnschlag
1674d406dc
made usage of comma as argument separator optional (largely untested, because we don't have anything that takes more than one argument)
2010-07-01 11:07:21 +02:00
Marc Zinnschlag
bf55880ce9
a bit of refactoring
2010-07-01 10:47:29 +02:00
Marc Zinnschlag
46fab68d44
implemented while loops
2010-07-01 10:42:49 +02:00
Marc Zinnschlag
69342f320d
added if control structure
2010-06-30 19:58:25 +02:00
Marc Zinnschlag
73f9436ed9
fixed round brackets parsing bug
2010-06-30 14:08:59 +02:00
Marc Zinnschlag
ed92ffcf89
added local variable usage in expressions
2010-06-30 12:46:10 +02:00
Marc Zinnschlag
fac8fb8fcb
added return and messagebox statements (messagebox does neither formating nor buttons yet)
2010-06-30 12:04:26 +02:00
Marc Zinnschlag
8bb2a6039d
modified comma handling to be morse consistent with original script language
2010-06-30 11:03:08 +02:00
Marc Zinnschlag
5fb4abae4f
added function parsing (only one function so far)
2010-06-29 17:51:02 +02:00
Marc Zinnschlag
c8c5ef5467
added bracket parsing
2010-06-29 16:24:54 +02:00
Marc Zinnschlag
48f6ad0f89
added basic arithmetic
2010-06-29 16:11:19 +02:00
Marc Zinnschlag
ca8002e533
added parsing for signed integers and floats
2010-06-29 12:05:22 +02:00
Marc Zinnschlag
ab33234027
prepared expression parser for implementation of more complex expressions
2010-06-29 11:24:07 +02:00
Marc Zinnschlag
6ebe2cff5f
extended expression parser for non-negative floats
2010-06-29 10:36:42 +02:00
Marc Zinnschlag
bceb7ebcbd
reimplemented expression parsing as a separate parser (still only handling non-negative integers)
2010-06-29 10:22:55 +02:00
Marc Zinnschlag
10cb9d3dab
made local variable names case-insensitive
2010-06-29 08:29:16 +02:00
Marc Zinnschlag
fdcd34941b
added parsing for set statement (only integer values so far); added code generator
2010-06-28 18:27:45 +02:00
Marc Zinnschlag
5cf3264bd3
added literal container and reworked output container handling
2010-06-28 16:48:19 +02:00
Marc Zinnschlag
ba847ae9d8
write local variable declarations into a separate file
2010-06-28 14:17:50 +02:00
Marc Zinnschlag
a3ad61b4d0
write code file after successfull parsing
2010-06-28 14:07:55 +02:00
Marc Zinnschlag
0cfeab622d
added storage class for local variable declarations; added checks for variable re-declaration
2010-06-28 13:28:50 +02:00
Marc Zinnschlag
21e0182ae2
added skip parser for skipping faulty lines
2010-06-28 12:47:11 +02:00
Marc Zinnschlag
bff0855af0
added parsing for local variable declarations
2010-06-28 12:32:08 +02:00
Marc Zinnschlag
16f6f27a90
added line parser (doesn't parse anything yet)
2010-06-28 12:12:47 +02:00
Marc Zinnschlag
fda7077cf2
bug-fix: comments were eating up newlines
2010-06-28 11:40:48 +02:00
Marc Zinnschlag
8930134d82
exception class fix
2010-06-28 11:38:21 +02:00
Marc Zinnschlag
aa99a0dd56
added basic script parser (can only parse empty script bodies for now)
2010-06-28 11:38:04 +02:00
Marc Zinnschlag
de8a651df4
improved error handling
2010-06-28 01:01:48 +02:00
Marc Zinnschlag
a068ca78d7
replaced dummy parser with top level file parser
2010-06-28 00:50:48 +02:00
Marc Zinnschlag
d20e850d31
-> wasn't properly translated into a token
2010-06-27 22:31:03 +02:00
Marc Zinnschlag
ddcbc8cd62
added tokenizing of MW scripts
2010-06-27 19:20:21 +02:00