Jump to content

1st time working on scripting. Please help if possible.


bryanwee20

Recommended Posts

Hi guys, just a brief description of what I am working on before I go further into what I need advise on.

 

The mod is intended to add an additional crafting station called the "Armor Painting Rack". It's supposed to provide a immersive way of inserting custom retextures of vanilla armor without cluttering up the forge. The crafting station is meant to be dynamic in the sense that the user has to mount the armor onto the rack and the player gets to see the armor on the rack before the actual painting process begins. Imagine Painted shield mod from immersive armors, except in this case its for the main armor parts.

 

All I can say is that the mod is more or less done. Scripting is almost done but i kinda hit a "speed bump". i'm having problems with double scripts running at the same time.

 

To be more detailed:

 

1) Activating the empty rack brings up a menu to select the type of armor you wanna "paint".

2) After selecting the armor type, The empty rack mesh is then disabled (Removed).

3) Armor rack mesh corresponding to the armor type selected, is Enable from previously disabled state.

4) Activating the "new" armor rack, a new menu pops up, prompting user to dismount the armor or to proceed on.

 

This is where I'm facing a little issue.

 

1) I kinda used a regular forge and changed the name and keyword to make the "new" armor rack.

2) I then added a second script that would trigger the menu to pop up.

 

I know.. I know.. not very intelligent of me. I thought it was sequential thing, where if one script is before another would mean it would run first. -_-"

 

So bottom line is, I want to know what I need to do in order for it the crafting menu to trigger on after the player clicks on the confirmation button. If anyone who knows how to do this please help me out or maybe help point me in the right direction.

 

I'm so close to finishing it, the mod is perfectly functional if you don;t count the trigger issues with the crafting menu.

I would be very grateful to whom ever can help. PS here's a link to what Im working on.

Link to comment
Share on other sites

You'll need to either A) block default activation via script (using http://www.creationkit.com/BlockActivation_-_ObjectReference) or B) Use a Perk with an Activation Entry and having Replace Default checked (http://www.creationkit.com/Perk_Entry_Point)

 

Those would be the two options I would look at to inject script before a normal activation. (Personally I prefer using a perk entry rather then the scripted way as it can generally be more flexible)

Edited by TidalWraith
Link to comment
Share on other sites

Hi thanks for the tips. Btw if its not to much to ask, could you take a look at this?

 

Scriptname ArmorPainterMenu extends ObjectReference
Message Property PaintingRackMenu01 Auto
ObjectReference Property CraftingArmorPaintingRackSTATIC Auto
ObjectReference Property CraftingArmorPaintingRack01 Auto
Event OnActivate(ObjectReference akActionRef)
Menu()
EndEvent
Function Menu(int aiButton = 0)
aiButton = PaintingRackMenu01.show()
If aiButton == 0
CraftingArmorPaintingRack01.disable()
CraftingArmorPaintingRackSTATIC .enable()
ElseIf aiButton == 1
EndIf
EndFunction
Link to comment
Share on other sites

I don't see any major issues with what you have but where is it actually attached if not to the PaintingRack?

 

Something to think about though would be the use of:

ObjectReference Property CraftingArmorPaintingRackSTATIC Auto
ObjectReference Property CraftingArmorPaintingRack01 Auto

That will force permanent persistence of the objects meaning they will stay in memory regardless of where you are in the world which isn't a good idea if you can help it. So you might want to try and use Events, Variables, Parenting, Linking or Quest Aliases (Only for 'Dynamic Quests') just some way to avoid using ObjectReference Properties. There's a page on the Creation Kit Wiki (Papyrus Persistance) it's a good read to see what you should try and avoid with some good tips at the end of the page.

Edited by TidalWraith
Link to comment
Share on other sites

WOOOHOOO.. FINALLY GOT IT!!

 

all i needed was just those few lines. I got too spoiled by java.

 

DUDE.. Thanks for the links. I was cracking my head try to use a function to return a bool to change the block activation function i tried using on the armor rack. I was going about it all wrong in terms of concept.

------------------------------------------------------------------------------

Scriptname ArmorPainterMenu extends ObjectReference
Message Property PaintingRackMenu01 Auto
ObjectReference Property CraftingArmorPaintingRackSTATIC Auto
ObjectReference Property CraftingArmorPaintingRack01 Auto
Event OnActivate(ObjectReference akActionRef)
CraftingArmorPaintingRack01.BlockActivation()
Menu()
EndEvent
Function Menu(int aiButton = 0)
Bool reTrig
aiButton = PaintingRackMenu01.show()
If aiButton == 0
CraftingArmorPaintingRack01.disable()
CraftingArmorPaintingRackSTATIC .enable()
ElseIf aiButton == 1
CraftingArmorPaintingRack01.Activate(Game.GetPlayer(), true)
EndIf
EndFunction
Link to comment
Share on other sites

This is looking good! I presume you've conditioned each button in your message to only show if you have that armor in your inventory, yeah? And is this only for painting the main armor piece or boots/gauntlets/etc. as well.

 

If you haven't conditioned each button, that's probably okay - just make sure you're using RemoveItem to grab the armor from the player, and then move it to the display however you want. Otherwise, if you use AddItem, even if the PC doesn't have the armor they could just keep adding it. :O Exploit right there. :)

 

There's a conditions box that you can put conditions on for each option in your message. Here is a list of all conditions:

 

http://www.creationkit.com/Condition_Functions

Link to comment
Share on other sites

Well, the menu is not really dynamic, Its pretty much a fixed menu for the moment.

I was kinda afraid of the menu stretching off screen.

 

I will still try out making menu button appearance conditional.

I foresee a long IfElse Statement, that is if the condition for buttons can't really do it by itself.

 

Thanks for the tips and links mate

Edited by bryanwee20
Link to comment
Share on other sites

Well, the menu is not really dynamic, Its pretty much a fixed menu for the moment.

I was kinda afraid of the menu stretching off screen.

 

I will still try out making menu button appearance conditional.

I foresee a long IfElse Statement, that is if the condition for buttons can't really do it by itself.

 

Thanks for the tips and links mate

The condition for buttons should be able to do it just fine. For example, if you want to do it for elven armor if the player has ALL parts of the elven armor:

 

GetItemCount ArmorElvenCuirass >= 1.0 Run On Player AND

GetItemCount ArmorElvenBoots >= 1.0 Run On Player AND

GetItemCount ArmorElvenHelmet >= 1.0 Run On Player AND

 

If you just want it so the player has ANY of those items, make those all ORs. If the PC only needs to have the Cuirass, just use the Cuirass condition. Cuirass and Helmets, make it Cuirass and Helmet condition only.

 

If there's something more complicated needs doing, feel free to ask me for some advice.

Edited by Mattiewagg
Link to comment
Share on other sites

  • Recently Browsing   0 members

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