Jump to content

New to Scripting


InActionMan64

Recommended Posts

Yep, that is exactly what I'm doing.

 

I'm using the SetOnCraftingEventHandler to return the iShot value, then consuming a single custom whiskey item (for the effects), then displaying a message and applying a custom effect.

 

I'm gonna try expanding the SetOnCraftingEventHandler script to include other custom items with messages and effects. It may make the recipe menu slow down, I'll have to check.

 

Cheers for all the help, so far.

Link to comment
Share on other sites

  • Replies 76
  • Created
  • Last Reply

Top Posters In This Topic

Yep, I don't seem to have got the hang of what search terms to try.

 

But I think I'm getting better, at least with your help it seems. :cool:

 

Edit: It looks like a good start but doesn't let you set conditions. I'll keep looking.

 

Edit: After humiliating myself with the obvious AddNewEffect I just been going through the JIP functions and there are so many helpful ones the search didn't turn up. I'm gonna spend sometime reading.

Link to comment
Share on other sites

RIGHT, I've got another REALLY simple one.

 

How can I get the script called by a base effect on an ingestible to know which ingestible called it ?

 

Example:

 

All types of Mentats share a base effect, that calls a script, that wants to know which Mentats called it, before applying an extra effect.

Link to comment
Share on other sites

So let me see if I understand you correctly ...

You are taking a vanilla mentat item ... and crafting it into another mentat item with an added effect.?

But using the JIP function AddNewEffect places it on the base form making all mentats now into the new item ?

Which you would like it to only effect the new reference of the base form created ( crafted item output) ?

 

Which I would say ... why not have a new mentat base form for the crafted item output ?

Which you just duplicated from the original and added a new effect ... therefore stuff like addiction & getting cured from it still function ?

 

However I do see one way to distinguish a reference ... which would be with one of these functions ...

https://geckwiki.com/index.php?title=SetOwnership

https://geckwiki.com/index.php?title=AddItemOwnership

 

And then your script runs one of these ...

https://geckwiki.com/index.php?title=GetOwner

https://geckwiki.com/index.php?title=HasOwnership

https://geckwiki.com/index.php?title=IsOwned

https://geckwiki.com/index.php?title=IsOwner

 

By the way ... these functions might help out also in other aspects of what you are trying to achieve ... if I'm understanding it correctly ?

https://geckwiki.com/index.php?title=SetScript

https://geckwiki.com/index.php?title=AddScriptVariable

https://geckwiki.com/index.php?title=SetOnUseAidItemEventHandler

Link to comment
Share on other sites

Didn't explain it well. I'll try again.

 

My mod will make changes to chems and alcohol. I don't want to set the changes through the GECK because other mods my change my changes.

I'm adding effects to chems and alcohol through a quest script for compatibility , I've done that bit already.

 

The effect would be added to most chems.

 

What I want is for the effect to call a script {like mods that add a 'get bottle back after drinking' effect} that would get the baseform of the chem that called the effect, so it could apply one of five additional effects.

 

Drugs A, B, C, D, E, have Effect X. Effect X calls Script Z. Script Z need to know A or B or C or D or E to apply Effect 1 or 2 or 3 or 4 or 5.

Link to comment
Share on other sites

So you add effect x at game start to all the vanilla ingestibles you want to mod ... which when one is consumed , runs that effect script , calling to z quest script , that is suppose to add an actor effect to the player based on which ingestible was consumed ?

Why can't you just add effect 1 to A , 2 to B, 3 to C, 4 to D , 5 to E at game start ?

 

There might be something in the effect type functions , like with array variables . But I'm not advanced enough to know how to use those.

So my method to achieve something like that would be just to directly attach said effect to said ingestible at run time.

Is there an extra condition you are achieving with your intended set up i'm missing ? Since you don't get to attach a condition with the AddNewEffect ?

Link to comment
Share on other sites

I'm already doing the 1 to A 2 to B, etc. It just feels a little clunky, multiple effects, multiple scripts, repetition.

 

I wanted to see if there was a way that effect 1 could be made adaptable, based on the ingestible.

 

I'm overcome the condition issue by attaching a custom effect with a script that applies the necessary positive / negative but that's only for one particular ingestible.

 

I'll keep looking, as always your input it INVALUABLE.

Link to comment
Share on other sites

Oh I forgot about this function https://geckwiki.com/index.php?title=IsSpellTargetAlt

Which based on "IsSpellTarget" that it replaces ... says it will check against an ingestible.

So scripting like this should work I guess ?

 

~~~~~~~~~~~~~~~~~

If PlayerRef.IsSpellTargetAlt Mentats == 1

; Do something

ElseIf PlayerRef.IsSpellTargetAlt Moonshine == 1

; Do something

ElseIf PlayerRef.IsSpellTargetAlt Morphine == 1

; Do something

endif

End

~~~~~~~~~~~~~~~~~

 

But also to mention other possibilities ... you can put hidden perks on the player that use this condition to turn on/off

Also with ingestible combinations like ...

 

PlayerRef : IsSpellTargetAlt : Mentats == 1 AND

PlayerRef : IsSpellTargetAlt : Moonshine == 1 OR

PlayerRef : IsSpellTargetAlt : Mentats == 1 AND

PlayerRef : IsSpellTargetAlt : Morphine == 1 AND

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...