Commit graph

1411 commits

Author SHA1 Message Date
Christoph Oelckers
4e802652c7 - scriptified ArtiBlastRadius. 2016-11-26 09:51:14 +01:00
Christoph Oelckers
7385cd70c0 - scriptified the Minotaur.
Interesting tidbit: The damage calculation in P_MinotaurSlam had been incorrect for the Heretic version since the friendly Hexen Dark Servant was added, but nobody ever noticed in 14 years...
2016-11-26 01:14:47 +01:00
Christoph Oelckers
6e1c6c4b33 - scriptified ArtiTeleport.
- shortened ArtiEgg and ArtiPork's use state to a single function.
2016-11-25 19:52:35 +01:00
Christoph Oelckers
0d6f37835f - completed Heretic scriptification with the two remaining artifacts. 2016-11-25 18:41:00 +01:00
Christoph Oelckers
4f370ba181 - scriptified the Phoenix Rod, completing the Heretic weapons. 2016-11-25 18:13:08 +01:00
Christoph Oelckers
8dba322775 - scriptified Heretic's Skull Rod.
- Took the opportunity and fixed the logic for the Skull Rod's rain spawner. The old code which was part of the 3D floor submission was unable to work with portals at all. The new approach no longer tries to hide the dead projectile in the ceiling, it leaves it where it is and changes a few flags, so that its z-position can be used as reference to get the actual ceiling. This works for line portals, but for sector portals still requires some changes to sector_t::NextHighestCeilingAt to work, but at least this can be made to work unlike the old code.
- added names for the player-related translations to A_SetTranslation.
- fixed: Failure to resolve a function argument was checked for, too late.
- made the parameter for A_SetTranslation a name instead of a string, because it is more efficient. We do not need full strings here.
2016-11-25 16:05:03 +01:00
Christoph Oelckers
b5f55cacba - removed test code. 2016-11-25 09:56:06 +01:00
Christoph Oelckers
11ac0c622b - fixed: The BFG needs to get its default ammo usage from the DehInfo struct.
- fixed: State's fields need to be declared native.
2016-11-25 01:33:04 +01:00
Edoardo Prezioso
c25774e311 - Fixed the Super Shotgun refire mismatch. 2016-11-25 00:42:09 +01:00
Christoph Oelckers
66d28a24b8 - disabled the scripted virtual function module after finding out that it only works if each single class that may serve as a parent for scripting is explicitly declared.
Needless to say, this is simply too volatile and would require constant active maintenance, not to mention a huge amount of work up front to get going.
It also hid a nasty problem with the Destroy method. Due to the way the garbage collector works, Destroy cannot be exposed to scripts as-is. It may be called from scripts but it may not be overridden from scripts because the garbage collector can call this function after all data needed for calling a scripted override has already been destroyed because if that data is also being collected there is no guarantee that proper order of destruction is observed. So for now Destroy is just a normal native method to scripted classes
2016-11-25 00:25:26 +01:00
Christoph Oelckers
9ae272d753 - scriptified Heretic's blaster.
- scriptified all Effect functions of Fastprojectile's children
- implemented access to class meta data.
- added a VM instruction to retrieve the class metadata, to eliminate the overhead of the function call that would otherwise be needed.
- made GetClass() a builtin so that it can use the new instruction

Important note about this commit: Scriptifying CFlameMissile::Effect revealed a problem with the virtual function interface: In order to work, this needs to be explicitly enabled for each single native class that may be used as a base for a scripted class. Needless to say, this will end up way too much work, as there are over 100 native classes, excluding those which will be scriptified. But in order to fix the problem this partially broken state needs to be committed first.
2016-11-24 20:02:44 +01:00
Christoph Oelckers
3f5bf88d69 - scriptified Heretic's mace.
- fixed: FxAssignSelf did not the correct number of registers for vector operations.
- fixed a few asserts in vector2 instructions.
- turned the virtual AActor::HitFloor method into a flag MF7_SMASHABLE. The only use of this function was to kill Hexen's pottery when they hit the floor, and this looks like something that can be exposed to modders less clumsily.
2016-11-24 13:45:43 +01:00
Edoardo Prezioso
3a059cbfd6 - Backported A_FireRailgun 'puffType' param from Zandronum.
Zandronum added this so that it could restore the original Skulltag piercing armor capability with a specific puff, like it's done with the other zdoom railgun action functions.
2016-11-24 11:31:40 +01:00
Christoph Oelckers
677d7579d4 - scriptified Heretic's crossbow and gauntlets. 2016-11-24 11:29:51 +01:00
Christoph Oelckers
2ece9b6172 - scriptified Heretic's staff and wand. 2016-11-24 10:39:16 +01:00
Christoph Oelckers
3e890d182b - scriptified D'Sparil.
- added retrieval of defaults from an actor pointer.
2016-11-24 01:23:35 +01:00
Christoph Oelckers
8a7671ad8b - exported all member fields from the morph items.
- renamed APowerMorph::Player to avoid accidental confusion with AActor::player, which in scripting is the same due to case insensitvity.
- renamed save key for above variable.
2016-11-23 23:28:03 +01:00
Christoph Oelckers
5e67cf79d3 - scriptified the Ironlich. 2016-11-23 21:26:59 +01:00
Christoph Oelckers
1a20a5b999 - scriptified A_PainShootSkull which was the last remaining bit in g_doom, so this directory is gone now. 2016-11-23 19:47:09 +01:00
Christoph Oelckers
7325e3f0f8 - exported all member fields that make sense. Entirely private ones or classes that are not supposed to be extended were left out. 2016-11-23 17:34:36 +01:00
Christoph Oelckers
0c95568d98 - exported native fields of several more classes. 2016-11-23 01:31:48 +01:00
Christoph Oelckers
46757ff8bf - exported the native fields of FState and FLevelLocals as well. 2016-11-23 00:35:06 +01:00
Christoph Oelckers
099b9970ef - added proper definitions for all exported native fields.
- synthesize native fields for all declared flags, not just for AActor.
2016-11-22 23:43:32 +01:00
Christoph Oelckers
980c986305 - allow defining native fields through scripts. Internally this only requires exporting the address, but not the entire field.
- added new VARF_Transient flag so that the decision whether to serialize a field does not depend solely on its native status. It may actually make a lot of sense to use the auto-serializer for native fields, too, as this would eliminate a lot of maintenance code.
- defined (u)int8/16 as aliases to the byte and short types (Can't we not just get rid of this naming convention already...?)
- exporting the fields of Actor revealed a few name clashes between them and some global types, so Actor.Sector was renamed to CurSector and Actor.Inventory was renamed to Actor.Inv.
2016-11-22 19:20:31 +01:00
Christoph Oelckers
bbb0778fd4 - scriptified Chicken and Pig - not tested yet, because other things have priority. 2016-11-22 12:21:55 +01:00
Christoph Oelckers
3db712cd73 - fixed: Switch statement without a default jumped to the first first case label instead.
- removed placeholder code from scripted Marine.
2016-11-21 22:20:25 +01:00
Christoph Oelckers
135cfcf016 - implemented State as an actual native struct, so that its fields can be accessed from scripts.
- refactored state bitfield members into a flag word because the address of a bitfield cannot be taken, making such variables inaccessible to scripts.
- actually use PNativeStruct for representing native structs defined in a script.
2016-11-21 21:34:34 +01:00
Christoph Oelckers
360436c201 - scriptified the scripted marines.
- fixed symbol name generation for native functions.
- moved PrintableName to VMFunction so that native functions also have this information.
2016-11-21 19:09:58 +01:00
Christoph Oelckers
97763b5a2b - added scriptable virtual overrides for PostBeginPlay, Tick, BeginPlay, Activate and Deactivate. 2016-11-21 14:59:17 +01:00
Christoph Oelckers
7c122d03e9 - renamed all instances of 'float' parameters to 'double', so that the Float32 type can be made usable for structs. 2016-11-21 13:04:27 +01:00
Christoph Oelckers
e7f6bae83e - implemented named arguments.
- fixed flag CVAR access. As it turned out, OP_LBIT is a bit messy to set up properly when accessing integers that may or may not be big endian, so it now uses a shift and bit masking to do its work.
- used the SpawnPlayerMissile call in A_FireBFG to test named arguments.
2016-11-21 01:32:01 +01:00
Christoph Oelckers
0cbd260f96 - replaced all calls to GetCVar with direct CVar accesses. 2016-11-20 23:39:37 +01:00
Christoph Oelckers
159f09105e - used static constant arrays to shorten some code. 2016-11-20 18:34:27 +01:00
Christoph Oelckers
bb25c5faaa - scriptified the remaining Doom weapon code.
- implemented method calls from struct instances.
- optimized disassembly of VM call instructions to print the function's name at the end where it is more visible and does not need to be truncated. Also use the printable name for script functions here.
2016-11-20 12:27:26 +01:00
Christoph Oelckers
3c726aa570 - scriptified A_FirePlasma. 2016-11-20 01:18:21 +01:00
Christoph Oelckers
fdab994fcb - scriptified the Rocket launcher. 2016-11-20 01:11:01 +01:00
Christoph Oelckers
814493b68d - scriptified the Super Shotgun. 2016-11-20 00:45:06 +01:00
Christoph Oelckers
af34d82888 - scriptified A_Saw.
- implemented multiple-return-value assignment. Due to some grammar conflicts the originally intended Lua-inspired syntax of 'a, b = Function()' could not be done, so it's '[a, b] = Function()'
2016-11-20 00:25:38 +01:00
Christoph Oelckers
0b70df88d8 - scriptified A_FireShotgun and A_FireChaingun. 2016-11-19 16:39:45 +01:00
Christoph Oelckers
d50da34664 - scriptified the pistol to test if struct member functions work.
- made APlayerPawn::PlayAttacking(2) virtual script functions so that mods have better control over player animations. Note that these have no native base so they skip the templated interface for managing virtual functions.
2016-11-19 13:56:29 +01:00
Christoph Oelckers
3ce699bf9b - implemented pass-by-reference arguments - so far only for memory based variables.
- changed Dehacked weapon function lookup to check the symbol table instead of directly referencing the VM functions. Once scriptified these pointers will no longer be available.
- removed all special ATAGs from the VM. While well intentioned any pointer tagged with them is basically unusable because it'd trigger asserts all over the place.
- scriptified A_Punch for testing pass-by-reference parameters and stack variables.
2016-11-19 01:23:56 +01:00
Christoph Oelckers
7ff5069617 - added all missing things to enable the scriptified version of A_BrainSpit.
This uses a global function, this has been placed into DObject for now because the scripting interface does not allow non-class-owned functions yet.
2016-11-18 22:12:53 +01:00
Christoph Oelckers
aa32d8970b - scriptified a_hereticmisc.cpp. 2016-11-18 21:34:06 +01:00
Christoph Oelckers
2cc48ec378 - implemented code generation for stack variables.
- fixed code generation for using local variables as array index. This must use a different register for the array element offset because the original register may not be overwritten.
2016-11-17 16:44:41 +01:00
Christoph Oelckers
21a1d5ffc8 - scriptified Hexen's Wraith and parts of the Spike. 2016-11-17 00:44:43 +01:00
Christoph Oelckers
df43ee96ce - fixed a lost '='.
- scriptified A_TimeBomb.
2016-11-16 21:12:16 +01:00
Christoph Oelckers
7a29e6cfdc - scriptified Hexen's fog. 2016-11-16 20:00:25 +01:00
Major Cooke
60d93008ba Exported TryMove. 2016-11-16 19:47:06 +01:00
Christoph Oelckers
76a74e0364 - scriptified Hexen's Dragon.
- fixed several places in the code generator that did not consider locked registers for local variables: array indices, abs and floating point builtin functions.
- added some debug aids to the bounds opcode. Just triggering an exception here which loses all relevant info is perfectly useless in a debug situation.
2016-11-16 19:18:21 +01:00
Christoph Oelckers
633da6e5d8 - scriptified two of the Acolyte's functions.
- added a DActorIterator class.
- fixed: It was not possible to have functions of the same name in two different classes because the name they were searched for was not qualified by the class. Changed so that the class name is included now, but to avoid renaming several hundreds of functions all at once, if the search fails, it will repeat with 'Actor' as class name.

This commit contains preparations for scriptifying Hexen's Dragon, but that doesn't work yet so it's not included.
2016-11-16 01:36:21 +01:00