Jump to content

Photo

[REL] Script Dragon


  • This topic is locked This topic is locked
205 replies to this topic

#1
Alexander Blade

Alexander Blade
  • Members
  • Adept
  • Joined: 29-July 09
  • 333 posts
Next topic

What is this ?
This is the skyrim engine extender, which allows to use skyrim script functions in 3rd party ScriptDragon plugins.

Download (developer sdk included)
http://Alexander.San...on_1.2.12.0.zip
Mirror http://www.multiupload.com/8WIRE9WV5R

How this all works ?
At first, let me list all necessary files, open "bin" folder pls
dinput8.dll -- loads all dlls with *.asi extension from the game dir, if you are similar with gta mods you should know what is this. Current loader was rebuilt especially for skyrim and works with all steam patches.
*.asi plugins -- each asi file represents one script example
ScriptDragon.dll -- ScriptDragon engine itself
*.ini files -- config files which are using by *.asi plugins in runtime

When game launches it loads dinput8.dll, dinput8.dll loads all *.asi libraries from the game directory, first loaded *.asi plugin loads ScriptDragon engine library ScriptDragon.dll, all other loaded *.asi plugins are using previously loaded ScriptDragon.dll. While further loading *.asi registers itself in the ScriptDragon.dll. When game will be loaded each *.asi script will be restarted. Scripts are not working while menu/map/etc is active, for example if you will open console all scripts will be paused until you close it.

Compatibility
Fully compatible with TESV.exe 1.1.21.0, 1.2.12.0
Fully compatible with steam
Should be compatible with SKSE

Current release
v1.2.12.0:
Added support of new 1.2.12.0 (rus and eng) patch
Added support of 1.1.21.0rus patch
Fixed few rare bugs
v1.1.21.0:
First beta release

Installing
Copy all contents of the "bin" folder to the game folder (where TESV.exe is), if you don't need ScriptDragon example plugins (*.asi) you may delete them and corresponding *.ini files.

Example plugins
horsespawner -- spawns a horse in front of you (default key is HOME)
undress -- allows to take off a closes (NO NUDE HERE!) from any game ped, press console (~), select needed ped via left mouse button, close console and press DELETE (by default)
weather -- changes current weather, default keys are PAGE_UP and PAGE_DOWN
trainer -- implementation of a simply trainer, default keys are (NUM1 - add skills; NUM2 - add perks; NUM3 - increase carry weight; NUM4 - toggles god mode; NUM5 - learn words; NUM6 - add daedric items and some stuff)

Videos
You can watch ScriptDragon examples in action here:
http://www.youtube.c...h?v=N0lEINaNdhk
http://www.youtube.c...h?v=EsdcGd6Yt4U

Edited by Alexander Blade, 03 December 2011 - 02:55 PM.


#2
Mardoxx

Mardoxx
  • Members
  • PipPipPip
  • Diviner
  • Joined: 17-November 11
  • 2077 posts
  • Location:England
Pretty cool

One thing, the source code for the trainer adds Ebony Arrows, why not Daedric arrows? :P

Edited by Mardoxx, 26 November 2011 - 09:09 PM.


#3
Phyber

Phyber
  • Members
  • Pip
  • Curate
  • Joined: 12-September 04
  • 805 posts
For a moment i thought this is used to change the script behaviour of dragons.
Still very good release. *applaud*

#4
Alexander Blade

Alexander Blade
  • Members
  • Adept
  • Joined: 29-July 09
  • 333 posts
Mardoxx
Copied incorrect arrow name :spotted owl:

#5
Speedo

Speedo
  • Members
  • Novice
  • Joined: 01-May 06
  • 47 posts
Looks very interesting and could be insanely useful. But if you want this thread to stay open, you probably need to clarify this:

Current loader was rebuilt especially for skyrim and has steam-crypt bypass feature.


Even the implication that you're disabling the DRM will have the mods locking this thread in a heartbeat. I'd also suggest releasing your source code. Many people (myself included) are not fond of downloading DLLs from random places on the internet without some way to verify that they don't contain anything malicious.

#6
Alexander Blade

Alexander Blade
  • Members
  • Adept
  • Joined: 29-July 09
  • 333 posts
Speedo
Thx ! Made a correction to the post . I'll think about srcs .

#7
shadeMe

shadeMe
  • Members
  • PipPipPipPip
  • Master
  • Joined: 26-June 08
  • 9416 posts
  • Location:In the Great Hall and in the Bladder
Really interesting stuff you got there :thumbsup: I had a quick look at the example code and it looks like you're creating a separate worker thread for each script "plugin". Are the various Papyrus/ObScript functions being called in them thread safe? If I recall correctly, they weren't back in Oblivion.

Edited by shadeMe, 27 November 2011 - 01:34 AM.


#8
hitachihex

hitachihex
  • Members
  • Novice
  • Joined: 15-November 11
  • 31 posts
Nice work.

Only thing I can complain about, is that there's a lot of redundancy in the code itself. The plugins that is.

#9
Alexander Blade

Alexander Blade
  • Members
  • Adept
  • Joined: 29-July 09
  • 333 posts
shadeMe
Not threads, im using fibers which are executing only in the original context of the hooked papyrus thread. Hook is placed in the function which is calling when papyrus wants to execute script opcode (so when no scripts are executing like when menus are opened DragonScript will be paused too). In that hook i have a 'tick' which executes all fibers one by one :
void ExecuteFibers()
{
	if (Plugins.size() > 0)
		for (DWORD I = 0; I < Plugins.size(); I++)
			if (Plugins.at(I).Current && ( GetTickCount() > Plugins.at(I).WaitTick) )
			{
				//Print("switching to fiber");
				SwitchToFiber(Plugins.at(I).Current);
			}
}
When fiber calls Wait() im switching back to the papyrus thread :
void _stdcall Wait(int time)
{
	void *Current = GetCurrentFiber();
	if (Plugins.size() > 0)
		for (DWORD I = 0; I < Plugins.size(); I++)
			if (Plugins.at(I).Current == Current)
			{
				Plugins.at(I).WaitTick = GetTickCount() + time;
				//Print("switching back to the primary fiber");
				SwitchToFiber(Plugins.at(I).Primary);
				break;
			}
}
When the cycle in the ExecuteFibers() ends original execution continues. So all script funcs are being called safely.

Edited by Alexander Blade, 27 November 2011 - 02:11 AM.


#10
shadeMe

shadeMe
  • Members
  • PipPipPipPip
  • Master
  • Joined: 26-June 08
  • 9416 posts
  • Location:In the Great Hall and in the Bladder
Ah, I see. Thanks for the clarification :) On an unrelated note, any particular reason why you chose not to implement your tool as a SKSE plugin? Just curious.

#11
ChairGraveyard

ChairGraveyard
  • Members
  • Adept
  • Joined: 10-November 11
  • 211 posts
@Alexander Blade, I'm currently writing a horse whistle button plugin, and I can't seem to get the horse to get any faster than a slow walk. I've tried setting the SpeedMult actor value, setting the movement type via the SetMovementType (to Horse_Sprint_MT). Any ideas?

#12
xenofixus

xenofixus
  • Members
  • Acolyte
  • Joined: 29-August 06
  • 135 posts
This is very cool...

Is there any way you can make it so it loads the scripts from a sub-folder like SKSE does for it's plugins? Do you plan to open source this? Or make it into a SKSE plugin?

Edited by xenofixus, 27 November 2011 - 04:19 AM.


#13
ChairGraveyard

ChairGraveyard
  • Members
  • Adept
  • Joined: 10-November 11
  • 211 posts
Also, is there a way to get a list of favorites?

#14
Alexander Blade

Alexander Blade
  • Members
  • Adept
  • Joined: 29-July 09
  • 333 posts
shadeMe
The main thing of SKSE plugin is that it shud work on any game version cuz SKSE will done every address findings . Whats the point of making the plugin which must be updated with every patch :biggrin:

ChairGraveyard
Actor::SetActorValue(your_horse, "speedmult", val);
Current actor value is in percents , so x2 speed will be when val=200 . Also be aware that in order to apply speed change while riding the horse u need to press horse_sprint button - LEFT ALT by default (thats how skyrim engine works) . You can test via console - select the horse using LMB and then type setav speedmult 1000 - it will only change when u will use the sprint . I did something familiar few days ago so if u need help with this i can provide the code .
Edit: regarding the lists
I didn't try to work with lists yet but u shud check ID_BGSListForm enum in enums.h , if there will be no needed list then it's not a list at all or enum entry is missing and u can find it only exploring skyrim.esm file

xenofixus
There is - create folder named "asi" and put all *.asi and *.ini there, ScriptDragon.dll must be placed near TESV.exe anyway so u can't move it

Edited by Alexander Blade, 27 November 2011 - 05:11 AM.


#15
ChairGraveyard

ChairGraveyard
  • Members
  • Adept
  • Joined: 10-November 11
  • 211 posts

shadeMe
The main thing of SKSE plugin is that it shud work on any game version cuz SKSE will done every address findings . Whats the point of making the plugin which must be updated with every patch :biggrin:

ChairGraveyard
Actor::SetActorValue(your_horse, "speedmult", val);
Current actor value is in percents , so x2 speed will be when val=200 . Also be aware that in order to apply speed change while riding the horse u need to press horse_sprint button - LEFT ALT by default (thats how skyrim engine works) . You can test via console - select the horse using LMB and then type setav speedmult 1000 - it will only change when u will use the sprint . I did something familiar few days ago so if u need help with this i can provide the code .

I tried setting the SpeedMult setting before. It does not appear to effect the PathToReference based movement, at least not as far as I can see. To be clear I'm not talking about doing anything to the horse while the player is riding it. I'm making the horse come to the player's current position. Right now it happens at the slowest walk speed (as if holding down the SHIFT in its default configuration of toggling walk) with the slow walk animation. Setting the movement type and the SpeedMult didn't work at all.

#16
Alexander Blade

Alexander Blade
  • Members
  • Adept
  • Joined: 29-July 09
  • 333 posts
try to set param afWalkRunPercent value in Actor::PathToReference(...) between 0.0 and 1.0 , it _shud_ work - i can see that game checks this range while executing this native

#17
ChairGraveyard

ChairGraveyard
  • Members
  • Adept
  • Joined: 10-November 11
  • 211 posts
Hmm right I forgot to try the other setting for that value when also setting the speed.

Edit: Nope, setting the afWalkRunPercent to 1.0 or 0.0 both have the same behavior as I've been seeing the whole time.

http://pastebin.com/stsLgD4R That's a paste of my code.

Edited by ChairGraveyard, 27 November 2011 - 05:31 AM.


#18
Alexander Blade

Alexander Blade
  • Members
  • Adept
  • Joined: 29-July 09
  • 333 posts
i checked one more time and value is definitely must be [0;1] also i looked into the original scripts and only one test script MovementTestRig.pex is using this , so probably native is deprecated and buggy

#19
shadeMe

shadeMe
  • Members
  • PipPipPipPip
  • Master
  • Joined: 26-June 08
  • 9416 posts
  • Location:In the Great Hall and in the Bladder

shadeMe
The main thing of SKSE plugin is that it shud work on any game version cuz SKSE will done every address findings . Whats the point of making the plugin which must be updated with every patch :biggrin:

Um, I'm not sure I understand your first sentence. Are you implying that your current implementation doesn't have to be updated for every official patch made to the game executable? If yes, how so? You'll still end up having to update the addresses of the native function handlers you're calling from your code, right?

#20
The Hologram

The Hologram
  • Members
  • Acolyte
  • Joined: 18-May 08
  • 193 posts
I haven't looked at what was released but I'm guessing he could be using techniques to search for hooked functions and only if that signature changes does the code break. I could be wrong but I've seen that used in trainers quite a bit to avoid breaking when new files are released. I'm seriously impressed with the sophistication of the mod and love that you have opened it up as an SDK.

Is there a way to test for the presence or version of one of these extenders in the game? If not will there be? It might be useful if these could register themselves with a script so that they can be checked for. Obviously not all scripts are that way but I could see people wanting to disable a mod if one of these scripts was not present.

#21
ChairGraveyard

ChairGraveyard
  • Members
  • Adept
  • Joined: 10-November 11
  • 211 posts
http://skyrimnexus.c...ile.php?id=1767

For now, since there doesn't seem to be a way currently to get the horse to move faster when using PathToReference, I'm just going to release it as is. No idea what happens if the horse isn't in a loaded cell, but it shouldn't cause any problems at least.

#22
Alexander Blade

Alexander Blade
  • Members
  • Adept
  • Joined: 29-July 09
  • 333 posts
shadeMe
No , im not doing address autosearch , i meant that i need to add new addresses into the ScriptDragon engine each time new patch outs , but the point of the definition "plugin" is "write once use everywhere" so it must be game version independent so all address stuff shud be done in SKSE . Current version of SKSE can't provide me all necessary addresses so there is no clue to be dependent on SKSE .

ChairGraveyard
Good :biggrin:

#23
ChairGraveyard

ChairGraveyard
  • Members
  • Adept
  • Joined: 10-November 11
  • 211 posts
@Alexander Blade, do you know if there's a "SetRunning" function that you haven't mapped out yet? The slow horse is driving me nuts.

#24
ChairGraveyard

ChairGraveyard
  • Members
  • Adept
  • Joined: 10-November 11
  • 211 posts
@Alexander Blade, There's a function that comes up when I do "help sprint 2" called SetPathSprinting but I can't get it to do anything. If I use it while the horse is selected (with the RefID showing above the console) it says "Must be called on an actor". If I call it using the RefID without the horse selected, it says that the function wasn't found.

Any ideas?

Edit: There's also a Script Function called SetForceRun, which I similarly can't seem to get to do anything.

Edited by ChairGraveyard, 27 November 2011 - 04:13 PM.


#25
ChairGraveyard

ChairGraveyard
  • Members
  • Adept
  • Joined: 10-November 11
  • 211 posts
Shouldn't EvaluatePackage be taking a TESPackage as well as the actor?

#26
Alexander Blade

Alexander Blade
  • Members
  • Adept
  • Joined: 29-July 09
  • 333 posts
ChairGraveyard
I mapped out all funcs except <console only> . I did a console test with SetPathSprinting and SetForceRun, seems none of 'em are working at all .
Console cmd SetPathSprinting must be used while ref is selected and have only 1 int param , its bool - only 0 or 1 -- no actor result for any of params
SetForceRun also must be used when ref is selected and have 1 int param and still no actor reaction for this .
Seems like a huge amount of console functions are doesn't affecting current engine internals at all .

EvaluatePackage is a native member of Actor class in the scripts (probably gets the cost of all actor items) , i didn't do any param / param type / funcs / members naming , thats how this was done by skyrim developers :biggrin:

#27
ianpatt

ianpatt
  • Members
  • Pip
  • Curate
  • Joined: 09-March 05
  • 764 posts
  • Location:Gregminster, Toran Republic

The main thing of SKSE plugin is that it shud work on any game version cuz SKSE will done every address findings . Whats the point of making the plugin which must be updated with every patch :biggrin:

Generally we don't, actually. C++ plugins (almost) always need to be recompiled for each version of the runtime. The reason for this is that plugins are written as if they're native game code. Most of our API is intended to just expose the internal API of the game, along with class structures and other things like that. We aren't trying to make an abstraction layer; there is too much to wrap.

#28
hitachihex

hitachihex
  • Members
  • Novice
  • Joined: 15-November 11
  • 31 posts
I've used ScriptDragon to create a rather simple mod - perk resetting, works pretty well, and without the CK, this was kind of needed, at least for some people. Thanks again for releasing.

Perk Reset

#29
AYuPro

AYuPro
  • Newbie
  • Layman
  • Joined: 18-January 11
  • 4 posts
This Mod didn't work with new TESV.exe.
When new version SkriptDragon be created?

[img]http://img1.uploadscreenshot.com/images/orig/11/33108213427-orig.png[/img]

http://bethplanet.ru/

Edited by AYuPro, 28 November 2011 - 10:42 AM.


#30
AYuPro

AYuPro
  • Newbie
  • Layman
  • Joined: 18-January 11
  • 4 posts
Little mod:
toggle menu by hit F11
http://dl.dropbox.co.../togglemenu.rar


2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users