Jump to content

[LE] 3 things I'd like help for (critical hits, random %,...)


arael53

Recommended Posts

Hello,

 

I'm not really good at modding, but I'd like to achieve 3 things, I hope someone will be able to help me:

 

1) I'm looking for a way to link an effect to a creature's critical hit, similar to the way to add an effect triggered by weapons critical hits.I want some creature to only apply their effect (poison, etc...) on a critical hit.

is there a way to do something like this ?

 

2) I'd like to get a random % to trigger an effect, relative to an actor value. As an example, I'd like to get a random chance to be staggered, relative to the stamina. 100% stamina would mean 0% chance to get staggered, 99% stamina would mean 1% to get staggered; etc... Is there a way to do that with the CK ?

 

3) Finally, is there a tesedit script or any other way to change the armor rating of all armors at once (that could check armor added by mods too) ? I'd like to reduce their AR value (between 30 or 40% of their vanilla value), but I'd rather not edit every armor one by one in the CK if a quicker way exist.

 

Thanks !

Link to comment
Share on other sites

1)

Script

OnHit... probably not best but fastest way :x...

 

2)

OnHit( ... )

if( Utility.RandomInt( Stamina ) == Utility.RandomInt( Stamina ) )

Stamina = 25 ( chance 1 to 25 to be staggered )

Stamina = 10 ( chance 1 to 10 to be staggered )

Stamina = 1 ( 100% chance to be staggered )

 

// this script above is not finished xD lol

 

3)

Perk

- Create new, and in Perk give it Modify Armor Rating lel :x...

 

 

 

- Do you know anything about Scripts in Skyrim? and CK...

cause all of this is possible but you have to know scripts :tongue:

 

like short example in "2)"

 

 

But, how about already existing mods?

for example TK Hit? if i remember this mod do thing nr. 2

 

and i know there was Mod for Critical Strikes and Mod for change armor rating

WeaponDMG UI is mod to change all weapon DMG, but because im not using armors idk/r this mod name :c...

Edited by TobiaszPL
Link to comment
Share on other sites

Thanks for your answer !

 

I'm familiar with the CK ( the "3)" is actually pretty easy, thanks for that ^^)

 

But not with scripts at all... I guess I'll have to learn, even if I suppose it's not that simple... I'll try to find some tutorial for the basics at first. And I should learn from existing mods as well, if it's possible to see their scripts. s I understood, there are some thing to avoid in scripts in skyrim for the saves not to be bloated. is there some documentations about it ?

Link to comment
Share on other sites

; HEY ;

Its not finished, tomorow i go for job interviev

ill try to finish it tomorow if i will have time :c...

 

at leats you have 2/3 Stages and Stage 3 is already started

writing this post took me 1.5 hour :x... and i still have to "get ready" for job interviev xD

 

this time im gonna be RICH :o !...

i go for 4$ / hour :o

 

last time i was working for only 2$ / hour xDDD

so my money got double :oooooo

 

now im pretty happy cause i lost my last job xD thats why i dont want to fail this inteviev :o

 

OK bye xD i lost another 5 min to write this xDDD

ill be back tomorow if i find time or ill be back at saturday

 

 

 

 

 

 

 

 

 

Hello I'm Tobi and This is my EPIC [TUT] for Papyrus Skyrim :smile:

( remember my english is potato !... )

 

::

- 1) How to create Script

- 2) How to attach Script

- 3) How to write Script :smile:

::

 

Something rly helpful:

:: Go to Skyrim directory path, and find "SkyrimEditor.ini"

be sure Your lines looks like this

[General]
bAllowMultipleMasterLoads=1
:: This will allow You to load more than one Master File ( Skyrim, Dawnguard, Dragonborn, Hearthfire )
[MESSAGES]
bBlockMessageBoxes=1

:: This will block MessageBoxes, so You will not have to cancel everything before you start CK

 

 

<<< STAGE 1 >>>

- How to create first SCRIPT file

 

 

Point a:

 

 

- To create Script firs you have to unpack scripts.rar

inside this RAR file you have all SRC files which are needed in order to create scripts !...

 

../Skyrim/Data < Find Scripts.rar >

../Skyrim/Data < Unpack Scripts.rar here >

 

 

 

 

Point b:

 

 

- Now you can create new Script, first start Your Creation Kit and Load Your Mod.

Then when CK is loaded find "Gameplay" on top menu bar ( here where You have file -> save for example )

from Gameplay list pick "Papyrus Script Manager" and wait to Load

 

If you extract SRC files ( Sripts.rar ) You should already see Vanilla Scripts and other mods Scripts

To create Your own script click with RIGHT Mouse and then select NEW

 

You should see "Add New Script" Window

- Create name:

 

More about names:

 

 

remember to create Your own TAG for example all my scripts have "QLG" in name

"QLG_MasterScript_TheRadio"

"QLG_MasterScript_TheArena"

"QLG_SimpleScript_Campfire"

"QLG_Script_ToggleLight"

 

by using TAG-s in name it will be easier to find stuff You need, You should keep this practices for every thing in CK

for example:

"QLG_Static_Building_Wall01"

"QLG_Static_Furniture_Chair01"

"QLG_Item_Misc_Food_Apple01"

 

with this finding items you look for will be much easier

also you will be able to copy/paste a lot of things at once for example you want to copy/paste house

 

BUT only walls

- using normal names without tags you will have problem... cause sorting will place items... pretty randomly

- using TAGs items of this same type will be ALWAYS together !...

 

 

 

for now i recomend You to name Your first Script "ARA_Testing" ( 3 first letters of your name + Testing )

i also have Script like this :smile: "QLG_Testing" im using it to test new Functions etc.

 

 

but name is one thing, you also have to type something for "Extends" for now enter "ObjectReference"

Extends is something like #Include for C++ you will just have acces to functions of Extended Type

 

Few examples:

- ObjectReference ( For Static objects, activators etc. )

- Actor ( For ofc. NPCs )

- ActiveMagicEffect ( for Magic ofc. )

 

and some more but those 3 Extends are in my opinion most use :o

 

You can ignore description, just press OK and find your SCRIPT in Papyrus Script Manager ( Point a )

 

 

 

Point c:

 

 

Now you should see Your created Script

now go to

 

../Skyrim/Data/Scripts/Source < here >

 

If you don't have to any good Text Editor i recomend You to use:

Notepad++

https://notepad-plus-plus.org/

https://notepad-plus-plus.org/ 

attach *.psc files to N++

- Click with right mouse any file ( from ../Skyrim/Data/Script/Source <here> )

- From List Menu choice "Start with"

- Select "Use this program for this file type"

- Start any script and you can close it

 

 

now go back to CK and click YOUR script with Right Mouse Click and select "Open in External Editor"

Your script should open in N++ or any other TXT Exe if You fail with attaching psc to N++ :tongue:

 

Your script should looks like this:

Scriptname ARA_Testing Extends ObjectReference


And DONE !...

You create SCRIPT ^_^ for now its Empty :smile:

we will fix it in next Stage :smile:

 

 

 

 

 

 

 

<<< STAGE 2 >>>

- How to ATTACH SCRIPT to OBJECT

 

 

Point a:

 

 

i hope you know how to create interior cell,

create one and put dwemer leaver inside your interior cell

 

- ID:( DweLever01 )

 

Ofc. this will help You understand how scripts works

normaly You don't need any levers and Sweetrolls

 

More about script activation:

 

 

:: You can activate script by:

- Activator

- TriggerBox

- Hit with weapon / Magic

- Animation

- Other Script

- Time

- Game Time

- Quest

and many actions with objects etc.

 

 

 

Ok, now double click Your placed Dwemer Leaver in Your cell

and go to "SCRIPT" It wont be be visible until you scroll menu bars

 

You should have buttons arrows to left and right click right arrow untill you see "SCRIPT"

click it and you should saw Script window, there should be already one Script - don't delete it :o

 

Click "ADD" Button and select Your script"

Your script should be now in Script list for this object

 

 

- Remember to edit OBJECT IN RENDER window

don't change Objects in OBJECT WINDOW ( this window on Right by default )

 

And DONE :D !...

You have added script to your lever ^^

 

GoTo("Stage3")

GoTo Stage3

jmp Stage3

call Stage3

line+=9

 

just open Stage 3 Spoiler :wink:

 

 

 

 

 

 

<<< STAGE 3 >>>

- How to WRITE SCRIPT

 

 

Programming we can divide to two "Memory" and "Operations"

like in real life we can remember something and we can do something with somethign :smile:

 

in Programming Memory is called "Variables"

and Operations are called "Functions"

 

Point a:

 

 

Variables are divided to many types for example

- Simple Varialbe ( store one number )

Example:

 

 

:: Int ( for "full numbers" without second part ( only 1 2 3 4 5 etc. ) ( can't be 1.428 or 3.14 ) )

:: double ( for numbers with second part ( for example 3.14 but also can be 1 2 3 4 etc. ) )

:: float ( this same as double )

:: char ( characters for example # $ % but also A B C D etc. )

 

 

- Structures ( store many types or many objects of this same type )

Example:

 

 

Struct{

int , int , double };

 

 

- Classes ( big objects with many operations and many data - for example NPCs or Magic )

- Arrays ( long line of object with this same type )

- Pointers ( more advance var, maybe ill try to explain it later )

 

And some more, atm we have to know only about Simple Variables

 

for papyrus we only have to know about Int and Float

 

:: INT ::

Data example: ( 3 ) or ( 14 ) or ( -582 ) or ( 0 )

Int is variable only for full numbers without second part

 

:: FLOAT ::

Data example: ( 3.14 ) or ( -69.96 ) or ( 16.529 )

Float is variable with second number

 

 

To create new Variable we have to write it TYPE and then NAME example:

Scriptname ARA_Testing Extends ObjectReference

int PlayerLife = 100
int PlayerMana = 30

int PlayerLevel = 2

Float GameCost = 9.99
Float LevelProgress = 57.34
 

Remember, in this same scope we can have ONLY ONE variable with this same name

about scope we don't have to talk now, maybe we will do it later

 

scope example C++:

 

 

Those are examples for C++ You can't use it for Papyrus !...

 

EXAMPLE 1:

 

 

int Main()
{
	int a=14;
	
	here A is visible with value equal to 14
	
	{
		int a=3;
		
		here A is visible wiht value equal to 3
		
		{
			double a = 3.14;
			
			here A is visible as DOUBLE and vith value 3.14
			
		}
		
		here A is visible with value 3
	}
	
	here A is visible with value 14
	
} 

 

 

EXAMPLE 2:

 

 

int main()
{
	// BODY LEVEL 0 ( MAIN LAYER )
	{
		// BODY LEVEL 1
		
		{ BODY LEVEL 2 }
		
		// BODY LEVEL 1
	}
	// BODY LEVEL 0 ( MAIN LAYER )
} 

 

 

 

 

 

Always when you create new Script in this same file you can have only ONE

Variable or ONE Function with this same name, name must be Unique !...

 

int a

float a

 

is invaild !... even if they have different type, they have this same name so computer will

have no idea which one variable you want to use cause we use variables and fuctions BY NAME

 

Something cool: ( You don't have to read this if you don't want to )

 

 

Void Hello( ... )
{
	// Code
} 

You can use memory adres instead of names, but in order to do it you have to

register your variable or use pointer to "steal" memory from PC

 

ofc. using memory by for example pointer without telling it your PC may cause some problems

for example your Antivirus may delete your program and code or you can simply crash your program

 

if you write script, this script will crash whole game... but ofc. in Papyrus we can't use POINTERS

 

ofc. we can create dynamic insane long array of ints and never delete it...

for example something like this

int *arr;

void CreateArray()
{
	arr = new int[250000];
	return;
}

int main()
{
	int *Pointer;
	CreateArray();
	
	Pointer = arr;
	while(true)
	{
		// do stuff
	}
	delete [] arr;
} 

with this we register 250.000 INT CELLS in MEMORY for any use we want

250.000 INT CELLS = 1.000.000 BYTES

1.000.000 = 8.000.000 BITS

 

Ofc. that was only fun fact :smile:

 

 

 

Nice !... Now you should know how to create Variables ^_^

we will TEST it later :smile:

 

go to point b :smile:

 

 

Point b:

 

 

 

 

 

 

 

Link to comment
Share on other sites

; HEY ;

Its not finished, tomorow i go for job interviev

ill try to finish it tomorow if i will have time :c...

 

at leats you have 2/3 Stages and Stage 3 is already started

writing this post took me 1.5 hour :x... and i still have to "get ready" for job interviev xD

 

this time im gonna be RICH :o !...

i go for 4$ / hour :o

 

last time i was working for only 2$ / hour xDDD

so my money got double :oooooo

 

now im pretty happy cause i lost my last job xD thats why i dont want to fail this inteviev :o

 

OK bye xD i lost another 5 min to write this xDDD

ill be back tomorow if i find time or ill be back at saturday

 

 

 

 

 

 

 

 

 

Hello I'm Tobi and This is my EPIC [TUT] for Papyrus Skyrim :smile:

( remember my english is potato !... )

 

::

- 1) How to create Script

- 2) How to attach Script

- 3) How to write Script :smile:

::

 

Something rly helpful:

:: Go to Skyrim directory path, and find "SkyrimEditor.ini"

be sure Your lines looks like this

[General]
bAllowMultipleMasterLoads=1
:: This will allow You to load more than one Master File ( Skyrim, Dawnguard, Dragonborn, Hearthfire )
[MESSAGES]
bBlockMessageBoxes=1

:: This will block MessageBoxes, so You will not have to cancel everything before you start CK

 

 

<<< STAGE 1 >>>

- How to create first SCRIPT file

 

 

Point a:

 

 

- To create Script firs you have to unpack scripts.rar

inside this RAR file you have all SRC files which are needed in order to create scripts !...

 

../Skyrim/Data < Find Scripts.rar >

../Skyrim/Data < Unpack Scripts.rar here >

 

 

 

 

Point b:

 

 

- Now you can create new Script, first start Your Creation Kit and Load Your Mod.

Then when CK is loaded find "Gameplay" on top menu bar ( here where You have file -> save for example )

from Gameplay list pick "Papyrus Script Manager" and wait to Load

 

If you extract SRC files ( Sripts.rar ) You should already see Vanilla Scripts and other mods Scripts

To create Your own script click with RIGHT Mouse and then select NEW

 

You should see "Add New Script" Window

- Create name:

 

More about names:

 

 

remember to create Your own TAG for example all my scripts have "QLG" in name

"QLG_MasterScript_TheRadio"

"QLG_MasterScript_TheArena"

"QLG_SimpleScript_Campfire"

"QLG_Script_ToggleLight"

 

by using TAG-s in name it will be easier to find stuff You need, You should keep this practices for every thing in CK

for example:

"QLG_Static_Building_Wall01"

"QLG_Static_Furniture_Chair01"

"QLG_Item_Misc_Food_Apple01"

 

with this finding items you look for will be much easier

also you will be able to copy/paste a lot of things at once for example you want to copy/paste house

 

BUT only walls

- using normal names without tags you will have problem... cause sorting will place items... pretty randomly

- using TAGs items of this same type will be ALWAYS together !...

 

 

 

for now i recomend You to name Your first Script "ARA_Testing" ( 3 first letters of your name + Testing )

i also have Script like this :smile: "QLG_Testing" im using it to test new Functions etc.

 

 

but name is one thing, you also have to type something for "Extends" for now enter "ObjectReference"

Extends is something like #Include for C++ you will just have acces to functions of Extended Type

 

Few examples:

- ObjectReference ( For Static objects, activators etc. )

- Actor ( For ofc. NPCs )

- ActiveMagicEffect ( for Magic ofc. )

 

and some more but those 3 Extends are in my opinion most use :o

 

You can ignore description, just press OK and find your SCRIPT in Papyrus Script Manager ( Point a )

 

 

 

Point c:

 

 

Now you should see Your created Script

now go to

 

../Skyrim/Data/Scripts/Source < here >

 

If you don't have to any good Text Editor i recomend You to use:

Notepad++

https://notepad-plus-plus.org/

https://notepad-plus-plus.org/ 

attach *.psc files to N++

- Click with right mouse any file ( from ../Skyrim/Data/Script/Source <here> )

- From List Menu choice "Start with"

- Select "Use this program for this file type"

- Start any script and you can close it

 

 

now go back to CK and click YOUR script with Right Mouse Click and select "Open in External Editor"

Your script should open in N++ or any other TXT Exe if You fail with attaching psc to N++ :tongue:

 

Your script should looks like this:

Scriptname ARA_Testing Extends ObjectReference


And DONE !...

You create SCRIPT ^_^ for now its Empty :smile:

we will fix it in next Stage :smile:

 

 

 

 

 

 

 

<<< STAGE 2 >>>

- How to ATTACH SCRIPT to OBJECT

 

 

Point a:

 

 

i hope you know how to create interior cell,

create one and put dwemer leaver inside your interior cell

 

- ID:( DweLever01 )

 

Ofc. this will help You understand how scripts works

normaly You don't need any levers and Sweetrolls

 

More about script activation:

 

 

:: You can activate script by:

- Activator

- TriggerBox

- Hit with weapon / Magic

- Animation

- Other Script

- Time

- Game Time

- Quest

and many actions with objects etc.

 

 

 

Ok, now double click Your placed Dwemer Leaver in Your cell

and go to "SCRIPT" It wont be be visible until you scroll menu bars

 

You should have buttons arrows to left and right click right arrow untill you see "SCRIPT"

click it and you should saw Script window, there should be already one Script - don't delete it :o

 

Click "ADD" Button and select Your script"

Your script should be now in Script list for this object

 

 

- Remember to edit OBJECT IN RENDER window

don't change Objects in OBJECT WINDOW ( this window on Right by default )

 

And DONE :D !...

You have added script to your lever ^^

 

GoTo("Stage3")

GoTo Stage3

jmp Stage3

call Stage3

line+=9

 

just open Stage 3 Spoiler :wink:

 

 

 

 

 

 

<<< STAGE 3 >>>

- How to WRITE SCRIPT

 

 

Programming we can divide to two "Memory" and "Operations"

like in real life we can remember something and we can do something with somethign :smile:

 

in Programming Memory is called "Variables"

and Operations are called "Functions"

 

Point a:

 

 

Variables are divided to many types for example

- Simple Varialbe ( store one number )

Example:

 

 

:: Int ( for "full numbers" without second part ( only 1 2 3 4 5 etc. ) ( can't be 1.428 or 3.14 ) )

:: double ( for numbers with second part ( for example 3.14 but also can be 1 2 3 4 etc. ) )

:: float ( this same as double )

:: char ( characters for example # $ % but also A B C D etc. )

 

 

- Structures ( store many types or many objects of this same type )

Example:

 

 

Struct{

int , int , double };

 

 

- Classes ( big objects with many operations and many data - for example NPCs or Magic )

- Arrays ( long line of object with this same type )

- Pointers ( more advance var, maybe ill try to explain it later )

 

And some more, atm we have to know only about Simple Variables

 

for papyrus we only have to know about Int and Float

 

:: INT ::

Data example: ( 3 ) or ( 14 ) or ( -582 ) or ( 0 )

Int is variable only for full numbers without second part

 

:: FLOAT ::

Data example: ( 3.14 ) or ( -69.96 ) or ( 16.529 )

Float is variable with second number

 

 

To create new Variable we have to write it TYPE and then NAME example:

Scriptname ARA_Testing Extends ObjectReference

int PlayerLife = 100
int PlayerMana = 30

int PlayerLevel = 2

Float GameCost = 9.99
Float LevelProgress = 57.34
 

Remember, in this same scope we can have ONLY ONE variable with this same name

about scope we don't have to talk now, maybe we will do it later

 

scope example C++:

 

 

Those are examples for C++ You can't use it for Papyrus !...

 

EXAMPLE 1:

 

 

int Main()
{
	int a=14;
	
	here A is visible with value equal to 14
	
	{
		int a=3;
		
		here A is visible wiht value equal to 3
		
		{
			double a = 3.14;
			
			here A is visible as DOUBLE and vith value 3.14
			
		}
		
		here A is visible with value 3
	}
	
	here A is visible with value 14
	
} 

 

 

EXAMPLE 2:

 

 

int main()
{
	// BODY LEVEL 0 ( MAIN LAYER )
	{
		// BODY LEVEL 1
		
		{ BODY LEVEL 2 }
		
		// BODY LEVEL 1
	}
	// BODY LEVEL 0 ( MAIN LAYER )
} 

 

 

 

 

 

Always when you create new Script in this same file you can have only ONE

Variable or ONE Function with this same name, name must be Unique !...

 

int a

float a

 

is invaild !... even if they have different type, they have this same name so computer will

have no idea which one variable you want to use cause we use variables and fuctions BY NAME

 

Something cool: ( You don't have to read this if you don't want to )

 

 

Void Hello( ... )
{
	// Code
} 

You can use memory adres instead of names, but in order to do it you have to

register your variable or use pointer to "steal" memory from PC

 

ofc. using memory by for example pointer without telling it your PC may cause some problems

for example your Antivirus may delete your program and code or you can simply crash your program

 

if you write script, this script will crash whole game... but ofc. in Papyrus we can't use POINTERS

 

ofc. we can create dynamic insane long array of ints and never delete it...

for example something like this

int *arr;

void CreateArray()
{
	arr = new int[250000];
	return;
}

int main()
{
	int *Pointer;
	CreateArray();
	
	Pointer = arr;
	while(true)
	{
		// do stuff
	}
	delete [] arr;
} 

with this we register 250.000 INT CELLS in MEMORY for any use we want

250.000 INT CELLS = 1.000.000 BYTES

1.000.000 = 8.000.000 BITS

 

Ofc. that was only fun fact :smile:

 

 

 

Nice !... Now you should know how to create Variables ^_^

we will TEST it later :smile:

 

go to point b :smile:

 

 

Point b:

 

 

 

 

 

 

 

Thank you for this detailed and rich post :laugh: English is not my first language either, I've found your answer pretty readable !

I've started to read some scripting tutorials, by using notepad++ I created a first basic script (the common one found in most scripting tutorial which pop a text when you load your game... Well, it's a start :laugh: )

With your explanation, I understood how to link a script to an object, that will come in handy later. So, if I want to detect a critical hit during an attack, I'll have to activate the script when I hit with a weapon.

 

Good luck for your job interview !

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...