Jump to content

How to make a Book an aid item


americanwierdo

Recommended Posts

Well looks like maybe there is an inherrent stop gate in "GetSelf" http://geck.bethsoft.com/index.php?title=GetSelf

 

Where it says this :

  • GetSelf will return 0 if called on a reference that has been created dynamically (for example, created via PlaceAtMe, or dropped from an inventory into the game world).
So a script placed on the book base-ID's like this might work ?
~~~~~~~~~~~~~
SCN MyBookXPScript
Ref rSelf
Begin OnAdd Player
Set rSelf to GetSelf
If rSelf == 1
RewardXP 15
endif
End
~~~~~~~~~~~~~~~~~~~~~
Which would automatically give XP on picking the book up from its original Ref instance , and hopefully not do the same if putting the book into a container then taking it back out again.
But also instead of using "RewardXP 15" Could just use "Player.Additem MyXPIngestible"
Which you would need to use a base effect , script type archetype. Which then had the line of "RewardXP 15"

But find out if you can limit picking the book up to a one time deal with that script first.

Edited by Mktavish
Link to comment
Share on other sites

EDIT: Scripts attached to objects have a unique instance for each reference, btw.

 

Sorry, I don't want to get involved with instructing you if you're not familiar with scripting because then I just end up troubleshooting beginner problems. It's simple stuff, so just following some basic tutorials and checking the wiki should get you through. Here are some example scripts which will work, though:

scn PreWarBookSCRIPT

begin OnAdd PlayerREF

	PlayerREF.AddItem PreWarBookAid 1 1
	RemoveMe

end
scn PreWarBookXPEffectSCRIPT

begin ScriptEffectStart

	if (GetIsReference PlayerREF)
		RewardXP 15
		AddItem PreWarBookUsed 1 0
	else
		AddItem PreWarBookAid 1 1
	endif

end
Edited by PushTheWinButton
Link to comment
Share on other sites

 

EDIT: Scripts attached to objects have a unique instance for each reference, btw.

 

 

Thats good to know ... but it seems there would be a game bloat problem having a few hundred unique scripts keeping track of their own DoOnce short variable ... No ???

Link to comment
Share on other sites

 

 

EDIT: Scripts attached to objects have a unique instance for each reference, btw.

 

 

Thats good to know ... but it seems there would be a game bloat problem having a few hundred unique scripts keeping track of their own DoOnce short variable ... No ???

 

In theory, yes, but I think It's harder than people think to cause significant bloating. Remember, all the encounters in Fallout 3 use PlaceAtMe functions and there's technically no limit to how many times they can occur; likewise potion crafting and enchanting in Oblivion and Skyrim use cloned objects. Saves naturally increasing in size is just a fact of playing the game, and of using mods in general.

 

That's not to say you shouldn't avoid adding unnecessary stuff when possible. So in this case, yes, perhaps a different method would be more professional due to the number of objects.

Edited by PushTheWinButton
Link to comment
Share on other sites

 

EDIT: Scripts attached to objects have a unique instance for each reference, btw.

 

Sorry, I don't want to get involved with instructing you if you're not familiar with scripting because then I just end up troubleshooting beginner problems. It's simple stuff, so just following some basic tutorials and checking the wiki should get you through. Here are some example scripts which will work, though:

scn PreWarBookSCRIPT

begin OnAdd PlayerREF

	PlayerREF.AddItem PreWarBookAid 1 1
	RemoveMe

end
scn PreWarBookXPEffectSCRIPT

begin ScriptEffectStart

	if (GetIsReference PlayerREF)
		RewardXP 15
		AddItem PreWarBookUsed 1 0
	else
		AddItem PreWarBookAid 1 1
	endif

end

I like your idea for a script but it doesn't seem to be working. The problem is that it doesn't add experience. It will, however, add a used prewar book that appears in the Misc section. But the EXP doesn't go up at all.

 

What could be the problem? Does it have something to do with those references you mentioned?

Link to comment
Share on other sites

His Idea is using 2 different scripts ... and the effect script must of course be on an effect.

 

IDK ... would be easier to just use my first script with the DoOnce. On the book Base-Id's

Edited by Mktavish
Link to comment
Share on other sites

The first script is for Pre-War books, to replace them with a new Aid Pre-War book when picked up. The second script is for the script effect which is to be attached to the aid Pre-War book.

 

I know, and I did that. Both scripts work properly, it's just that the "rewardxp 15" part isn't working for some reason. I wonder if maybe there's another way to phrase it. Perhaps it's a parameter issue.

Link to comment
Share on other sites

 

The first script is for Pre-War books, to replace them with a new Aid Pre-War book when picked up. The second script is for the script effect which is to be attached to the aid Pre-War book.

 

I know, and I did that. Both scripts work properly, it's just that the "rewardxp 15" part isn't working for some reason. I wonder if maybe there's another way to phrase it. Perhaps it's a parameter issue.

 

 

Hmmm perhaps " RewardXp" does not work inside of a "Begin ScriptEffectStart" block. Because RewardXP doesn't use a reference. And ScriptEffect requires one ??? IDK try a different block type ... but might need 2 scripts again just for that section. Or use a showmessage with buttons ?

Edited by Mktavish
Link to comment
Share on other sites

  • Recently Browsing   0 members

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