Jump to content

[LE] Advanced script help please.


Recommended Posts

I have a script that puts a menu [cancel][use][take] to allow the PC to pick up the a Workbench which will then disable it in game and add it to the PC inventory... that script works on it's own no problem...
but I also have another very popular mod running that puts a menu on all workbenches to allow [use][open store]
my menu then shows when selecting that ones [use]... If I then select [take] from mine it does disable and add it to PC inventory... so far so good...

but it then gets stuck because then the other script is still trying to operate on the now non-exsistent bench which of course it expects to still be there.

Is there a way stop the other script from mine or get mine to take priority thereby bypassing the other one?

Link to comment
Share on other sites

As far as I am aware, when you have 2 scripts that do a simular thing and aren't compatable, the only way to work around it is to change how the system works...

 

If they use menus, then use spells instead... Or use a custom form that won't have the attached scripts. Perhaps the other mod uses a specific formlist, a keyword, a global, something you can use to separate your mod from theirs.

Link to comment
Share on other sites

You know what you could do, instead of making the work benches portable, make a spell the can access a magical work bench at anytime. Just make pieces of furniture that use the correct work bench type. You can make it a kneel marker or something that spawns at the player, then forces him to activate the furniture piece/magic workbench. To prevent save bloat, you could use this code I made for a mod I am currently making on:

 

 

Scriptname WC_FurnitureCleanup extends ObjectReference
{Constantly makes sure the furniture is in use before deleting itself. Written by Wilbur Cobb / smashballsx88}

Actor property PlayerRef auto
{Assign this to (any) cell, PlayerRef. This is faster then Game.GetPlayer(), it will be good for looping scripts.}

Event OnInit()
	RegisterForSingleUpdate(4)	;It will begin the check loop in 4 seconds, this makes sure the player finishes entering the furniture before checking.
EndEvent

Event OnUpdate()
	if PlayerRef.GetSitState() != 3	;Checks if the player is still using the furniture. (3 = Sitting)
		self.delete()
	else
		RegisterForSingleUpdate(4)	;Runs the loop every 4 seconds, you can increase this as you see fit.
	endif
endEvent

 

 

 

Place it on the custom workbench, set it's property, and enjoy. The reason why I made this a loop, is so this way it will delete it self encase there is a bug that prevents you from using it.

 

You can manipulate it or do whatever you want with it, I just thought I throw the idea out there encase you wish to use an alternative.

Link to comment
Share on other sites

Why don't you create a new object - furniture, give it a specific ID and make your Script work only for that object (I assume the other mod you are talking about affects "only" vanilla Crafting furnitures).

If by any chance it also fires by using the "Name" - change the name too.

Link to comment
Share on other sites

Thanks guys :)

 

Using a spell's not going to work for what I need it for... for that it has to be sort of portable.

Interesting script though :)

 

I think I'm going to have to try and create my own workbench that the other script doesn't effect.

I did try one but the other script still found it so I must have missed something...

Link to comment
Share on other sites

I think I'm going to have to try and create my own workbench that the other script doesn't effect.

I did try one but the other script still found it so I must have missed something...

Well perhaps you could get with the mod author, the first step is to at least find out what the other mod's script searches for. Figure out how it identifies a work bench. Like I said, it could be a formlist, a keyword, .. etc. You probably wont know till you look at his script.

 

Perhaps find programs that can decompile mods... I do a lot of that my self. There is nothing wrong with taking a peak to see how something works, as long as you don't steal anything out of it.

Edited by smashballsx88
Link to comment
Share on other sites

  • Recently Browsing   0 members

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