Jump to content

Photo

Need help with Trophy Script

skyrim help script scripting sck

  • Please log in to reply
10 replies to this topic

#1
wilwhitt56

wilwhitt56

    Fan

  • Members
  • PipPipPip
  • 303 posts

Needing hrlp with a script ive been trying to use for several days. What im trying to do is make a Script for trophy mounts, like wolves and sabrecats. Ive been following Darkfox's tutorial for it, but ive run into a snag. His tutorial uses only 2 bases, mine has 21. When I follow his and try to compensate for mine, only the first 2 work right. What do I need to do have the script work for all 21? Keep in mind, I've ONLY JUST started messing with scripts, so go easy on me.

 

Here's the edited script that i tried to use. I figured a simple copy/paste did the trick since i didn't get an error when saving, but apparently not.

This is the activator:
Scriptname CGTestScriptTrophyActivator02 extends ObjectReference  
{This script deletes the trophy being activated and sets it's global back to 0.}
 
 
;Original script created by Darkfox127
;Any potential problems which may arise from this script being changed from the original are the sole responsibility of the mod author making the changes.
 
 
GlobalVariable Property Global_Trophy_Placed_01 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_02 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_03 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_04 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_05 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_06 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_07 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_08 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_09 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_10 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_11 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_12 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_13 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_14 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_15 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_16 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_17 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_18 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_19 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_20 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_21 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
 
Int Property XPos_TrophyMarker_01 Auto
{The X axis position of the X-Marker used for the first trophy base.}
Int Property XPos_TrophyMarker_02 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_03 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_04 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_05 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_06 Auto
{The X axis position of the X-Marker used for the first trophy base.}
Int Property XPos_TrophyMarker_07 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_08 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_09 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_10 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_11 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_12 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_13 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_14 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_15 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_16 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_17 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_18 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_19 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_20 Auto
{The X axis position of the X-Marker used for the second trophy base.}
Int Property XPos_TrophyMarker_21 Auto
{The X axis position of the X-Marker used for the second trophy base.}
 
LeveledItem Property Trophy_Craft_Items Auto
{A leveled list containing all of the items used for creating the trophy.}
 
ObjectReference Property PlayerREF Auto
{The default reference for the game to point toward the player.}
 
String Property ReturnMSG Auto
{The notification to show when the craft items have been returned to the player.}
 
 
 
Event OnActivate(ObjectReference akActionRef)
 
If (Self.GetPositionX() == XPos_TrophyMarker_01)
Global_Trophy_Placed_01.SetValue(0) ;Set the trophy global to 0 to allow the base to know a new trophy can be placed
ElseIf (Self.GetPositionX() == XPos_TrophyMarker_02)
Global_Trophy_Placed_02.SetValue(0) ;Set the trophy global to 0 to allow the base to know a new trophy can be placed
EndIf
 
PlayerREF.AddItem(Trophy_Craft_Items, 1, True) ;Silently give the player all of the items back which were used in this trophy's creation
debug.notification(ReturnMSG) ;Show a notification to inform the player their items have been returned to them
Self.delete() ;The trophy now deletes itself and is no longer visible on the trophy base, allowing for a new trophy to be put down
 
EndEvent
 
This is the Misc:
Scriptname CGTestTrophyScriptMisc02 extends ObjectReference  
{This script creates a trophy and places it on the trophy base currently being activated.}
 
 
;Original script created by Darkfox127
;Any potential problems which may arise from this script being changed from the original are the sole responsibility of the mod author making the changes.
 
 
Activator Property Trophy_To_Place Auto
{The trophy to create and place on the base.}
 
GlobalVariable Property Global_Trophy_Active Auto
{This will check to see which trophy base is currently set to active so that this craft menu knows where to place the trophy.}
GlobalVariable Property Global_Trophy_InUse Auto
{A global which is set after crafting an item to prevent the player from creating more than one trophy on the same stand.}
GlobalVariable Property Global_Trophy_Placed_01 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_02 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_03 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_04 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_05 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_06 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_07 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_08 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_09 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_10 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_11 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_12 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_13 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_14 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_15 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_16 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_17 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_18 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_19 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_20 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
GlobalVariable Property Global_Trophy_Placed_21 Auto
{The trophy global for the trophy base to know if a trophy is already in place.}
 
MiscObject Property Trophy_Item Auto
{This is the item created by the crafting menu which triggers these events. This is the item this script is attached to.}
 
ObjectReference Property TrophyMarker_01 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_02 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_03 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_04 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_05 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_06 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_07 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_08 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_09 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_10 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_11 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_12 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_13 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_14 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_15 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_16 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_17 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_18 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_19 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_20 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property TrophyMarker_21 Auto
{This will be one of the X-Marker Headings that your trophy is placed on.}
ObjectReference Property PlayerREF Auto
{The default reference for the game to point toward the player.}
 
 
 
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 
If (Global_Trophy_Active.GetValue() == 0) ;Is the current base tagged as 0?
 
debug.notification("Global Set Wrong")
 
ElseIf (Global_Trophy_Active.GetValue() == 1) ;Is the current base tagged as 1?
 
TrophyMarker_01.PlaceAtMe(Trophy_To_Place) ;Place the trophy at the relevant marker
Global_Trophy_Placed_01.Setvalue(1) ;Set base one as trophy placed
PlayerREF.RemoveItem(Trophy_Item,1,True) ; Removes the trophy misc item from the player's inventory silently
 
ElseIf (Global_Trophy_Active.GetValue() == 2) ;Is the current base tagged as 1?
 
TrophyMarker_02.PlaceAtMe(Trophy_To_Place) ;Place the trophy at the relevant marker
Global_Trophy_Placed_02.Setvalue(1) ;Set base two as trophy placed
PlayerREF.RemoveItem(Trophy_Item,1,True) ; Removes the trophy misc item from the player's inventory silently
 
EndIf
 
Global_Trophy_InUse.SetValue(1)
Utility.Wait(0.1)
Global_Trophy_InUse.SetValue(0)
 
EndEvent
 
 


#2
wilwhitt56

wilwhitt56

    Fan

  • Members
  • PipPipPip
  • 303 posts

Im looking at it now and... am i suppose to copy/paste these lines as well?

 

Activator:

ElseIf (Self.GetPositionX() == XPos_TrophyMarker_02)
Global_Trophy_Placed_02.SetValue(0) ;Set the trophy global to 0 to allow the base to know a new trophy can be placed
 
Misc:
ElseIf (Global_Trophy_Active.GetValue() == 2) ;Is the current base tagged as 1?
 
TrophyMarker_02.PlaceAtMe(Trophy_To_Place) ;Place the trophy at the relevant marker
Global_Trophy_Placed_02.Setvalue(1) ;Set base two as trophy placed
PlayerREF.RemoveItem(Trophy_Item,1,True) ; Removes the trophy misc item from the player's inventory silently


#3
ReDragon2013

ReDragon2013

    Old hand

  • Members
  • PipPipPip
  • 740 posts

The question is

  a) one baseobject "Trophy_Item" or

  b) 21 different baseobjects

with 21 markers to place a single trophy?

 

MiscObject Property Trophy_Item Auto
{This is the item created by the crafting menu which triggers these events. This is the item this script is attached to.}
 
And are the GlobalVariables used within these two scripts only?
 
GlobalVariable Property Global_Trophy_Placed_0x Auto
{The trophy global for the trophy base to know if a trophy is already in place.}


#4
wilwhitt56

wilwhitt56

    Fan

  • Members
  • PipPipPip
  • 303 posts

 

The question is

  a) one baseobject "Trophy_Item" or

  b) 21 different baseobjects

with 21 markers to place a single trophy?

 

MiscObject Property Trophy_Item Auto
{This is the item created by the crafting menu which triggers these events. This is the item this script is attached to.}
 
And are the GlobalVariables used within these two scripts only?
 
GlobalVariable Property Global_Trophy_Placed_0x Auto
{The trophy global for the trophy base to know if a trophy is already in place.}

 

It's suppose to be 21 trophy bases in total, with roughly 22 trophies in total. 18 of them are suppose to have the small to mid size one (falmer, sabrecat, bears) while 19 and 20 have mammoths. 21 will have a dragon trophy on it for 3 different dragons (bronze, swamp, and frost)



#5
wilwhitt56

wilwhitt56

    Fan

  • Members
  • PipPipPip
  • 303 posts

Im pretty sure it's just those two, but here's the one for the trophy base JIC

 

Base:

{Checks if a trophy is in place. If there is no trophy in place, this allows the player to add one.}
 
 
;Original script created by Darkfox127
;Any potential problems which may arise from this script being changed from the original are the sole responsibility of the mod author making the changes.
 
 
GlobalVariable Property Global_Trophy_Placed Auto
{DEFAULT: 0 This will be set to 1 once a trophy is placed to allow this base to know if a trophy is in place.}
 
GlobalVariable Property Global_Trophy_Active Auto
{This will allow the crafting menu to know which base to place the trophy on.}
 
Int Property Int_Trophy_Tag Auto
{Which trophy stand you want this trophy base to control.}
 
String Property FailMSG Auto
{The message you want to display if the player activates this base and a trophy is already in place.}
 
 
 
Event OnActivate(ObjectReference akActionRef)
 
If (Global_Trophy_Placed.GetValue() == 1) ;Is a trophy already in place?
debug.notification(FailMSG) ;Inform the player they cannot add a trophy is one is already in place
Else
Global_Trophy_Active.SetValue(Int_Trophy_Tag) ;The trophy base you are going to be adding a trophy to
Utility.Wait(0.1) ;Short delay to allow global changes to take effect
Self.GetLinkedRef().Activate(Game.GetPlayer()) ;Activates the craft system that your linked ref should point to
EndIf
 
EndEvent

Edited by wilwhitt56, 20 January 2022 - 09:26 PM.


#6
ReDragon2013

ReDragon2013

    Old hand

  • Members
  • PipPipPip
  • 740 posts

Sometimes its a good idea to use spoiler tags and its always fine to post a link where to find the original scripts. Keep it in mind!

 

mod: "Ressource Pack" made by Darkfox127 https://www.nexusmod...79519?tab=files
video: "Creation Kit (Custom Trophy Stands)", How to create multiple trophies? https://www.youtube....h?v=-4igxAUcJ3A

 

The trophy creation is using next three scripts.

  1 - DF_Script_Trophy_Base.psc
  2 - DF_Script_Trophy_Misc.psc
  3 - DF_Script_Trophy_Activator.psc

At first do not use the scriptnames (from above) provided by ressource pack. Make it unique enough like next:

  wilw_Trophy_Base.psc
  wilw_Trophy_Misc.psc
  wilw_Trophy_Activator.psc

Now I changed the original scripts in some code parts to make it easier to handle. You have to use an array and also to create a formlist.

 

DF_Script_Trophy_Base

Spoiler
wilw_Trophy_Base
Spoiler

 

DF_Script_Trophy_Misc

Spoiler
wilw_Trophy_Misc
Spoiler

Edited by ReDragon2013, 22 January 2022 - 05:57 AM.


#7
ReDragon2013

ReDragon2013

    Old hand

  • Members
  • PipPipPip
  • 740 posts

DF_Script_Trophy_Activator

Spoiler
wilw_Trophy_Activator
Spoiler

 

Advantage you do not have to deal with a lot of "X axis position of the X-Marker".


Edited by ReDragon2013, 22 January 2022 - 06:06 AM.


#8
wilwhitt56

wilwhitt56

    Fan

  • Members
  • PipPipPip
  • 303 posts

Im getting an error with the Misc Script, saying this. Also, how do i make a spoiler tag, and an Array? As I said, i'm VERY NEW to scripting.

EDIT: I'm looking at it, and I think it has to do with the two lines saying "By changing script name adjust here !!!"

 
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CG_Script_Trophy_Misc.psc(110,18): cannot convert to unknown type cg_trophy_activator
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CG_Script_Trophy_Misc.psc(110,18): cannot cast a objectreference to a cg_trophy_activator, types are incompatible
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\CG_Script_Trophy_Misc.psc(110,42): cg_trophy_activator is not a known user-defined type
No output generated for CG_Script_Trophy_Misc, compilation failed.

Edited by wilwhitt56, 22 January 2022 - 04:35 PM.


#9
ReDragon2013

ReDragon2013

    Old hand

  • Members
  • PipPipPip
  • 740 posts

(1) you wrote: "I'm VERY NEW to scripting."

Well.. a reason, but no thank you or any other good sign of you. I am really disappointed, in older days your postings were called "script kiddies"!

original scriptnames

   DF_Script_Trophy_Base.psc
   DF_Script_Trophy_Misc.psc
   DF_Script_Trophy_Activator.psc

my scriptnames

  wilw_Trophy_Base.psc
  wilw_Trophy_Misc.psc
  wilw_Trophy_Activator.psc
(oRef as wilw_Trophy_Activator).myF_Init(i)        ; <-- By changing script name adjust here !!!

your scriptnames

  cg_Trophy_Base.psc
  cg_Trophy_Misc.psc
  cg_Trophy_Activator.psc
(oRef as cg_Trophy_Activator).myF_Init(i)        ; <-- By changing script name adjust here !!!

(2) you wrote: "how do i make a spoiler tag"

Did you have a brain? If yes, use an internet web searcher or the forum search function (right on top).

Spoiler

Edited by ReDragon2013, 23 January 2022 - 07:37 AM.


#10
Sphered

Sphered

    Fan

  • Premium Member
  • 406 posts

So many properties

 

Oof...







Also tagged with one or more of these keywords: skyrim, help, script, scripting, sck

IPB skins by Skinbox
Page loaded in: 1.023 seconds