Jump to content

Welcome to LoversLab
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!

useful community scripts to start mods with


  • Please log in to reply
182 replies to this topic

#1
(Donkey)

(Donkey)
  • Guests
Post any cool,useful or just curious script you know.

If you are good scripting and don't mind releasing some for the community,please post your scripts here.

I have seen a similar post like this in the mount and blade boards and thought we could really use one for Oblivion as well. for Oblivion.

Not everyone is good at scripting, but are better in other areas. This could enhance there mods in a major way..

Since most mods for lovers requires lot's of scripts this could actually make that barrier simpler if they could have one place to start there search.
  • 0

AdBot

AdBot
  • Advert

#2
(Donkey)

(Donkey)
  • Guests
If anyone is interested what i am talking about please check this thread.It will give you an indication how useful this thread can be if used correctly.

http://forums.talewo...imabphldci102t3
  • 0

#3
UNREAL

UNREAL

    Member

  • Members
  • PipPipPip
  • 121 posts
What you need particularly?

  • 0

#4
(Donkey)

(Donkey)
  • Guests
Well not really for me, but someone starting out modding will mostly needs script witch could be way over his or her head. This will mostly be basic. To get you starting out.

If you look at the lovers structure, they make use of heavy scripting already. So if you want to creating anything funny for a lovers plug-in not only do you need scripts, but also understanding how they function in-game.
  • 0

#5
UNREAL

UNREAL

    Member

  • Members
  • PipPipPip
  • 121 posts
Well basic:
like spell on target or touch

scn aLoversTestSpell
int foff ;nude bits
int fdef ;nude bits
ref tar ;actor1
ref me ;actor2

begin scripteffectstart
set tar to player
set me to getself
if Call xLoversCmnIsReady tar ; ready or not sub function LPK
if Call xLoversCmnIsReady me ; ready or not

Let foff := 8+1024 ;nude bits (head, arms etc see in obse help)
Let fdef := 8+1024 ;nude bits (head, arms etc see in obse help)
set xLoversQuest.Offence to tar;
set xLoversQuest.Deffence to me

set xLoversQuest.SPos to 1 ;pose number

set xLoversQuest.OffNudeFlag to foff    ;nude
set xLoversQuest.DefNudeFlag to fdef  ;nude

tar.Call xLoversMainSafeStart ;start sex on tar(player) point
endif
endif
end
  • 0

#6
Chase Roxand

Chase Roxand

    Thing maker

  • Contributor
  • PipPipPipPipPip
  • 894 posts
I'm having some issues tracking the pairing information when it wasn't initiated by me. Could someone show example code of recalling some data such as the flags and motion number? Also, is there a way to access quest variables through GetFormFromMod?
  • 0

#7
(Donkey)

(Donkey)
  • Guests
Anyone know any sample script how those mounting horses works ?? i tried the one from vanilla game but somehow i can't mount my horse. The button does not work.

never mind got it to work..  :P
  • 0

#8
(Donkey)

(Donkey)
  • Guests
Here is useful one
;LoversCreaturesBedSafeStart
SCN xLoversCBStartSEXonBedR

; Option
; spos (short):

ref bed					;ref bed
ref me					;ref me
ref plr					;ref plr
long meZ				;long meZ
long plrZ					;long plrZ
short spos				;short spos
short lcir1				;shor lcir1
short lcir2				;shor lcir2
long percent			;long percent

Begin function { spos }

set plr to player																			; plr Player
set me to GetSelf																		; me Object RefID
set xLoversQuest.SPos to spos														; Lovers spos
set percent to GetRandomPercent													; percent 0-99

set plrZ to plr.Getpos z																; plrZ Player
set meZ to me.Getpos z																; meZ Object Z

if plrZ - MeZ >= 10 || plrZ - Mez <= -10										; plr me Z 10
	set percent to 1																		; percent 1
endif

if percent < 50																			; 50% 
	let bed := Call xLoversCmnGetUsableNearestBed plr me 500 0		; 、
	if bed																						; bed
		set xLoversQuest.ExtFlag to 1												; Lovers 
		set xLoversQuest.ExtRef to bed												; Lovers RefID
	endif
endif

Let lcir1 := Call xLoversCmnIsReady me
Let lcir2 := Call xLoversCmnIsReady plr

if lcir1 ==1 && lcir2 ==1																; xLoversCmnIsReady 
	Call xLoversMainSafeStart															; 
endif

RemoveMe																					; 

End

This is the script for bed. and regular one. If you want to use it. use the call function like this Call xLoversCBStartSEXonBedR 1

This will call the above script so if you are like me and make a menu all you have to do. use this:

Call xLoversCmnInitQuestInterface
set xLoversQuest.offence to GetSelf
set xLoversQuest.defence to Player
call xLoversCBStartSEXonBedR 1

If you want the player to take charge turn the above around player to offence and Getself to defence. That will make sure you will Be the aggressor.
  • 0

#9
Killerpenguin5

Killerpenguin5

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts
Donkey, could you please unban Destrocto\'s IP and account I\'m sorry for what I said, It was rude and uncalled for and I shouldn\'t of acted like another trolling douche who likes starting flame wars. 
Sincerest apologies from Destrocto.
  • 0

#10
Ashal

Ashal

    Administrator

  • Administrators
  • 4,315 posts

Donkey, could you please unban Destrocto\'s IP and account I\'m sorry for what I said, It was rude and uncalled for and I shouldn\'t of acted like another trolling douche who likes starting flame wars. 
Sincerest apologies from Destrocto.


I've unbanned it.
  • 0

#11
galgat

galgat

    Mega Poster

  • Contributor
  • PipPipPipPipPip
  • 2,166 posts
  this is mostly for new modders..

Lots of times you may want with dialog to do a bunch of things in the result box

example

set takeall to player.getitemcount 001CRsexslime
player.removeitemNS 001CRsexslime Takeall
set takeall to player.getitemcount Crelfhatecap
player.removeitemNS Crelfhatecap takeall
set takeall to player.getitemcount 001crgtsgreefring
player.removeitemNS 001crgtsgreefring takeall
set MixPotion to 0

I know poor example

any way result box is small, and troublesome to work with, i mean this will work, but.

instead in quest script make a short like " doall "

short doall

then add these lines in quest script

if doall == 1
set takeall to player.getitemcount 001CRsexslime
player.removeitemNS 001CRsexslime Takeall
set takeall to player.getitemcount Crelfhatecap
player.removeitemNS Crelfhatecap takeall
set takeall to player.getitemcount 001crgtsgreefring
player.removeitemNS 001crgtsgreefring takeall
                        setstage myquest 15
set MixPotion to 0
                        set doall to 0 ; set it right back to 0 you can call it with 1 again if needed
endif

now all you have to add to the result box in dialog is

set myquest.doall to 1

Quest scripts are very dependable as opposed to other things in the game
so this works very well.remember if you do a "setstage myquest" or "messagebox" do it at the bottom of the list.

Example

if doall == 1
set takeall to player.getitemcount 001CRsexslime
player.removeitemNS 001CRsexslime Takeall
set takeall to player.getitemcount Crelfhatecap
player.removeitemNS Crelfhatecap takeall
set takeall to player.getitemcount 001crgtsgreefring
player.removeitemNS 001crgtsgreefring takeall
set MixPotion to 0
                        set doall to 0 ; set it right back to 0 you can call it with 1 again if needed
                        Messagebox"fuck all this shit"
endif

Messagebox's act like a return, and everything after them will not get done, most of the time.

I know not much of a tip, but maybe it will help a few people.

  • 0

#12
(syrevo)

(syrevo)
  • Guests
Hello Everyone

First sorry about my bad English

I need help with a script which should allow the player when a key pressed on keyboard to switch between all NPC and creature references within a specific distance or number of cells and play some shader effect on the selected reference.
each time the key pressed then the script should move to a new reference cycling between them.
I tried to write the script my self as i do write some scripts but never succeeded creating a script contains (GetFirstRef) and (GetNextRef), it always end with a script error.

Please help, i tried construction set wiki to learn how to use both functions but not enough explanation regarding these two functions.
  • 0

#13
fg109

fg109

    Member

  • Members
  • PipPip
  • 18 posts
It's probably a better idea to use GetHighActors, otherwise you'd need to use GetFirstRef and GetNextRef every time you try to cycle through actors.

scn example

array_var Actors

float fquestdelaytime

ref tempref

short menu
short choice
short keycode
short index
short tempshort

Begin GameMode

	if (fquestdelaytime != 0.01)
		let fquestdelaytime := 0.01
		let Actors := ar_Construct Actors
		let menu := 1
		MessageBoxEX "Hold down a key and press 'Set Key' for use in cycling through nearby actors.%r|Set Key"
	endif

	if (menu == 1)
		let choice := GetButtonPressed
		if (choice < 0)
			let keycode := GetKeyPress 0
		else
			let menu := 0
			let choice := 0
			Return
		endif
	endif

	if (GetGameLoaded || GetCellChanged)
		ar_Erase Actors
		let Actors := GetHighActors
	endif
	
	if (OnKeyDown keycode)
		tempref.StopMagicShaderVisuals customshader
		let index += 1
		Label 1
		let tempshort := ar_Size Actors
		if (tempshort == 0)
			Return
		elseif (index >= tempshort)
			let index := 0
		endif
		let tempref := Actors[index]
		if (IsFormValid tempref == 0)
			ar_Erase Actors index
			GoTo 1
		endif
		tempref.PlayMagicShaderVisuals customshader
	endif
	
End

  • 0

#14
(syrevo)

(syrevo)
  • Guests

It's probably a better idea to use GetHighActors, otherwise you'd need to use GetFirstRef and GetNextRef every time you try to cycle through actors.

scn example

array_var Actors

float fquestdelaytime

ref tempref

short menu
short choice
short keycode
short index
short tempshort

Begin GameMode

	if (fquestdelaytime != 0.01)
		let fquestdelaytime := 0.01
		let Actors := ar_Construct Actors
		let menu := 1
		MessageBoxEX \"Hold down a key and press 'Set Key' for use in cycling through nearby actors.%r|Set Key\"
	endif

	if (menu == 1)
		let choice := GetButtonPressed
		if (choice < 0)
			let keycode := GetKeyPress 0
		else
			let menu := 0
			let choice := 0
			Return
		endif
	endif

	if (GetGameLoaded || GetCellChanged)
		ar_Erase Actors
		let Actors := GetHighActors
	endif
	
	if (OnKeyDown keycode)
		tempref.StopMagicShaderVisuals customshader
		let index += 1
		Label 1
		let tempshort := ar_Size Actors
		if (tempshort == 0)
			Return
		elseif (index >= tempshort)
			let index := 0
		endif
		let tempref := Actors[index]
		if (IsFormValid tempref == 0)
			ar_Erase Actors index
			GoTo 1
		endif
		tempref.PlayMagicShaderVisuals customshader
	endif
	
End


I can't Thank you enough for your help
your Script worked like a charm
Again thank you very much now I can continue my mod many thanks to you  :)


  • 0

#15
RogueMage

RogueMage

    Senior Member

  • Members
  • PipPipPipPip
  • 309 posts
Hi,

I am in need of assistence. I am trying to find out the cell in which a npc is sleeping. I want to do this with the sleep package (GetPackageLocationData). There are different options possible and one gives me a headache (searching for hours the cswiki now): 'Editor'. This is the position where the npc has been placed in the editor after creation. I found out that I can use GetStartingPos and GetStartingAngle to determine the position. But I cannot get a complete set of data to find out the cell or to position s.th. at this position. But how do I find out the cell-reference (need it to use GetParentCellOwner)? Please help!
  • 0

#16
grumbler

grumbler

    Member

  • Members
  • PipPipPip
  • 126 posts

Hi,

I am in need of assistence. I am trying to find out the cell in which a npc is sleeping. I want to do this with the sleep package (GetPackageLocationData). There are different options possible and one gives me a headache (searching for hours the cswiki now): 'Editor'. This is the position where the npc has been placed in the editor after creation. I found out that I can use GetStartingPos and GetStartingAngle to determine the position. But I cannot get a complete set of data to find out the cell or to position s.th. at this position. But how do I find out the cell-reference (need it to use GetParentCellOwner)? Please help!

A bit late here, I know, but I think you will have to enable the NPC. They don't sleep in remote cells unless they have been enabled, and they won't be enabled by the game unless their cell is loaded.

If there is some chance that the NPC is sleeping in any given cell, you could activate them in the cell randomly chosen from the possibilities presented by the game or mod that introduced the NPC.

It might help if you said which NPC are you trying to find, and why you don't know the cell in which that NPC sleeps.

  • 0

#17
ZaZ

ZaZ

    KinkAnimator

  • Contributor
  • PipPipPipPipPip
  • 1,775 posts
Hello , Have A lil Question
Umm How Do u Enchant Something that On wearing it It forces Special Animations ,
Specifically Walk Animations In My Case.
Im A bit Noob When It Comes To modding , A Helpful Script Perhaps Also I want only the The Animations I have And Disable the others
Is It possible ?

Thanx In Advance
:)
  • 0

#18
uglycat

uglycat

    Member

  • Members
  • PipPipPip
  • 92 posts
noob question!

xme: receiver/victim
zme: giver/attacker

correct?

is there somewhere i can find xlovers documentation maybe..?
  • 0

#19
Slammer64

Slammer64

    The Old Man of the Forum

  • Contributor
  • PipPipPipPipPip
  • 1,780 posts
I need a bit of scripting help myself, I need a sample script that gives me an idea how to handle adding a scripted token to an NPC via dialog and remove any other designated tokens at the same time. Like adding a wait token that calls a "Wait" script while removing a follow token that calls a "follow" script. Everything I have tried doesn't seem to work. I want to avoid putting anything in the result script box if I can, except for maybe adding the token in the first place. Any help would be appreciated, I just wish Oblivion scripting had an "if exists" function.
  • 0

#20
grumbler

grumbler

    Member

  • Members
  • PipPipPip
  • 126 posts
Slammer,

Can't you use GetInventoryObject and then RemoveItemNS?

This could be in a regular script attached to the added token, if this is always the function you want for that type of token. If not, you may need to condition it, or put the RemoveItemNS in the result script.
  • 0