Jump to content

Custom Cannibal perk not working


dudeapocalypse

Recommended Posts

So i made a perk on a Cannibal basis that allows you to devour abominations corpses when you equip a certain armor. I'm sure that it's added to the player because the script also adds Imagespace modifier and plays sound upon equipping armor, but the "Devour" menu does not appear when I'm sneaking above the abomination's corpse. Here's the perk add script and Cannibal perk edit:

 

scn 1NivVSLDevourAddPerk

begin OnEquip Player
if (Player.HasPerk 1NivVSLCannibal != 1)
Player.AddPerk 1NivVSLCannibal
PlaySound NPCSporeCarrierHissVox
ApplyImageSpaceModifier 1nivVSLDevourPerk2ISFX
endif
end

begin OnUnequip Player
Player.RemovePerk 1NivVSLCannibal
RemoveImageSpaceModifier 1nivVSLDevourPerk2ISFX
end

 

 

Link to comment
Share on other sites

"OnEquip" is a "single frame" block type. (See the "TIP Block Types Multiple vs Single Frame processing" entry under the "Scripting" section of the wiki "Getting started creating mods using GECK" article.) It may be adding the Perk (assumed because the rest of the script appears to be executed), but that does not "trigger" the Perk into action. For that you need a "GameMode" block script to test three conditions, with a "wrapper" condition block that checks to see if you are already in "Devour" mode:

1. the Perk is present.

2. an "abomination corpse" is present.

3. the player is "sneaking".

Only when all three conditions are "true" do you want the Perk to "trigger". All three of those tests should be separate, nested "conditional tests" so the subsequent only get tested when the earlier conditions are met, to reduce the overhead. When the "Perk" is triggered, you want to set the wrapper "flag" variable to signal you are in "Devour" mode, and clear that flag when eating is done. Example pseudo-script:

Begin GameMode

If NOT (bDevourMode) then
  If player.HasPerk 1NivVSLCannibal then
    If <AbominationCorpse> is within activation range then
      If Player.IsSneaking then
        set bDevourMode = true
        run Devour related script
      Else
        set bDevourMode = false
      EndIf
    Else
      ; Not a valid corpse
    EndIf
  Else
    ; Doesn't have the Perk
  EndIf
Else
  ; Currently "devouring" corpse
EndIf

End    

-Dubious-

 

 

Link to comment
Share on other sites

"OnEquip" is a "single frame" block type. (See the "TIP Block Types Multiple vs Single Frame processing" entry under the "Scripting" section of the wiki "Getting started creating mods using GECK" article.) It may be adding the Perk (assumed because the rest of the script appears to be executed), but that does not "trigger" the Perk into action. For that you need a "GameMode" block script to test three conditions, with a "wrapper" condition block that checks to see if you are already in "Devour" mode:

1. the Perk is present.

2. an "abomination corpse" is present.

3. the player is "sneaking".

Only when all three conditions are "true" do you want the Perk to "trigger". All three of those tests should be separate, nested "conditional tests" so the subsequent only get tested when the earlier conditions are met, to reduce the overhead. When the "Perk" is triggered, you want to set the wrapper "flag" variable to signal you are in "Devour" mode, and clear that flag when eating is done. Example pseudo-script:

Begin GameMode

If NOT (bDevourMode) then
  If player.HasPerk 1NivVSLCannibal then
    If <AbominationCorpse> is within activation range then
      If Player.IsSneaking then
        set bDevourMode = true
        run Devour related script
      Else
        set bDevourMode = false
      EndIf
    Else
      ; Not a valid corpse
    EndIf
  Else
    ; Doesn't have the Perk
  EndIf
Else
  ; Currently "devouring" corpse
EndIf

End    

-Dubious-

 

 

Thanks for the links, some things are a bit clearer now, (I'll need to create a "start game enabled" quest for that kind of scripts, right? Like for the ones that add items to leveled lists?) but I don't know if I'll figure it out on my own. I mean I can change weapon or ammo stats, but as far as scripting goes, really, I'm like a chimp in a space shuttle. Can you write an actual script please?

Link to comment
Share on other sites

Sorry, but I'm retired ... and that includes from creating mods. (Memory and health issues.) I've never actually created a mod for FNV at all. But it's not that different from the older games in the TES series. Scripting is scripting; it's mostly different syntax (and the quirks of the "Creation Kit") at the core of problems.

 

If I create a script then I feel I have to troubleshoot and support it. The forum takes up enough of my limited time just trying to research things people can't seem to find on their own, writing wiki articles, and giving pointers. And YOU don't learn anything from my doing the work.

 

If you intend to create mods, especially anything that is more than simply a replacement model for an existing item in the game, then you need to learn to script. The primary method is by examining example scripts from the vanilla game and mods doing similar things to what you want to learn. Then look through the "Scripting" section of the wiki "Getting started creating mods using GECK" article. That is a collection of lessons learned from the community, and it has links to tutorials as well as "TIP Adding Items to Actors aka Leveled Lists" and "TIP Preload Scripts". (Notice it is the largest section by far. There are many ways to "skin that cat" and when one doesn't do what you want, you have to find another or think "out of the box" and get creative on how to do it anyway.) That is what the "GECK and Modders" subforum is intended to help with.

 

-Dubious-

Link to comment
Share on other sites

For the vanilla cannibal perk , they just use an EntryPoint , OnActivate.

 

Then you put conditions on the Perk Owner , Like "GetEquipped" : "MyArmor" == 1

and "GetIsSneaking" == 1

 

And on the Target like "GetIsCreature" : "Abomination" == 1

and "GetDead" == 1

 

Then in the result script is where you have it play the visuals or anything else that can execute in a 1 frame block.

Which if you need a gamemode block , the result script could start one.

And with those conditions set , you only need add the perk once ... no reason to add / remove it with the armor.

Link to comment
Share on other sites

Sorry, but I'm retired ... and that includes from creating mods. (Memory and health issues.) I've never actually created a mod for FNV at all. But it's not that different from the older games in the TES series. Scripting is scripting; it's mostly different syntax (and the quirks of the "Creation Kit") at the core of problems.

Okay, well, thanks for the pointers.

 

 

For the vanilla cannibal perk , they just use an EntryPoint , OnActivate.

 

Then you put conditions on the Perk Owner , Like "GetEquipped" : "MyArmor" == 1

and "GetIsSneaking" == 1

 

And on the Target like "GetIsCreature" : "Abomination" == 1

and "GetDead" == 1

 

I know, the only thing I edited in original Cannibal perk except setting required level to 1 and making perk hidden is changed target to abomination. I tried setting armor having to be equipped in the conditions, but still no luck.

 

 

Then in the result script is where you have it play the visuals or anything else that can execute in a 1 frame block.

Which if you need a gamemode block , the result script could start one.

And with those conditions set , you only need add the perk once ... no reason to add / remove it with the armor.

Not sure if I understood everything correctly (I'm like a week into scripting and have no clue about programming at all, all I have done so far is changing variables in somebody else's scripts), but I want perk to be added with armor, it is like armor's effect.

Link to comment
Share on other sites

Ah sorry , I didn't bother looking at your posted pic because I thought you were trying to get the whole thing done with a script. But I see you are just using a script on the armor to add and take away the perk.

And duplicating the vanilla perk pretty much.

 

Which your only problem I see is , the playable and hidden flags are not either one or the other.

In this case you need both those checked ... maybe first just try it with the playable flag to make sure it gets added ... and test it out on an abomination. Then check the hidden flag also.

 

Hope that helps .

 

Add edit: Oh ya one more problem ... don't use numbers in the prefix of ANY IDs .

Do at least 2 letters first before using numbers.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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