Jump to content

New to Scripting


InActionMan64

Recommended Posts

  • Replies 76
  • Created
  • Last Reply

Top Posters In This Topic

You say that but I've got a simple script that validates and runs but doesn't produce a result and I cannot figure out what I've done wrong.

 

It's basically a direct copy from the Wiki.

 

I've rewritten it 3 times, attached it to different activators and nothing changes.

 

So 20 years seems about right.

Link to comment
Share on other sites

Update on IsSpellTarget.

 

Nope.

 

But it did lead me to HasMagicEffect.

 

So here's an example,

 

float RandomNumber
Begin ScriptEffectStart
set RandomNumber to GetRandomPercent
if player.getperkrank CustomPerk >= 2
if HasMagicEffect CustomEffect1
if RandomNumber >= 65
player.additem ExtraItem1 1
else
player.additem ExtraItem2 1
endif
elseif HasMagicEffect CustomEffect2
if RandomNumber >= 85
player.additem ExtraItem3 1
else
MessageEx No extra Item
endif
elseif RandomNumber >= 75
if HasMagicEffect CustomEffect3
player.additem ExtraItem4 1
else
player.additem ExtraItem5 1
endif
else
MessageEx Different No extra Item
endif
endif
end

 

Works like a charm.

Was able to condense four similar scripts down to one, put in a perk check and all without having to change the code that applies the Custom Base Effects.

 

Would never has got here so quickly without your help. Again Many Thanks

Link to comment
Share on other sites

Update on IsSpellTarget.

 

 

To clarify ... said to use "IsSpellTargetAlt"

 

But glad you got it working ... and I guess you figured out "HasMagicEffect" is looking for a base effect ... an effect item on the ingestible , not the ingestible itself ?

Where as IsSpellTarget and the Alt version are for checking Actor / object / ingestible effect form-ids .

Link to comment
Share on other sites

You say that but I've got a simple script that validates and runs but doesn't produce a result and I cannot figure out what I've done wrong.

 

It's basically a direct copy from the Wiki.

 

I've rewritten it 3 times, attached it to different activators and nothing changes.

 

So 20 years seems about right.

 

By the way ... care to post this up ? maybe I can point out what the problem is ?

Link to comment
Share on other sites

 

Update on IsSpellTarget.

 

 

To clarify ... said to use "IsSpellTargetAlt"

 

But glad you got it working ... and I guess you figured out "HasMagicEffect" is looking for a base effect ... an effect item on the ingestible , not the ingestible itself ?

Where as IsSpellTarget and the Alt version are for checking Actor / object / ingestible effect form-ids .

 

 

Yeah I meant IsSpellTargetAlt. Played around with it and found that HasMagicEffect better suited what I was doing. Would never have got to it had you not directed my to look at a SPELL based function.

 

The simple validating script that refused to work, turns out it was working I just wasn't looking at the results properly.

 

I'm starting to get into EventHandlers as a way of doing things. They're very handy.

Link to comment
Share on other sites

 

I'm starting to get into EventHandlers as a way of doing things. They're very handy.

 

 

Well you be going beyond me then ... I know of and have read about them ... but never used them in practice .

I guess you'll be teaching me in another couple weeks :teehee: :geek: :cool:

Link to comment
Share on other sites

NO, the knowledge is MINE and MINE ALONE!!!!!!!!!!!

 

I'm finding them handy for very specific interactions, circumstances like setting off a Wild Wasteland event. NV uses triggers for WW but you can use Event Handlers to do the same and they're temporary so they can be scripted and then thrown away.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...