Jump to content

Donation Script


Recommended Posts

Hey Guys

 

I have write a donation script for a Orphanage in a mod I working currently on. The problem is, it doesn't work. Can someone help me out here?

 

If it would have work, the player should have lost 100 caps and gain a temporary perk for 2 hours or so.

 

My Error message is: "C:\(...)\Orphanage.psc(8,13): no viable alternative at input '.' No output generated for Orphanage, compilation failed."

 

Steps I have done:

-I have attach the script on the line, where the npcs thanks the player, for his donation.

 

The Script looks like this:

 

Scriptname Orphanage extends TopicInfo

ReferenceAlias Property OrphanageALIAS Auto Const
MiscObject Property Caps001 Auto Const
Actor Property Player Auto Const
SPELL Property OrphanageSpell Auto Const

OrphanageSpell.Cast(Player, Player)
Player.removeitem(Caps001, 100)

 

Thanks already to everyone who can help me.

Link to comment
Share on other sites

The Script does not have a function or event wrapping the actions. Typically they use;

 

 

Event OnBegin(ObjectReference akSpeakerRef, bool abHasBeenSaid)
...
EndEvent

OR

 

Event OnEnd(ObjectReference akSpeakerRef, bool abHasBeenSaid)

...

EndEvent

 

Look at OpenInventoryInfoScript and such for guidance.

Link to comment
Share on other sites

Thank you so much SKK50! It has worked!

 

For everyone with a similar question who maybe look later in this thread, I post here now the script, that need to be attached on your donation giving line in the quest:

 

----------------------------

Scriptname Orphanage extends TopicInfo

ReferenceAlias Property OrphanageALIAS Auto Const
MiscObject Property Caps001 Auto Const
Actor Property Player Auto Const
SPELL Property OrphanageSpell Auto Const

Event OnEnd(ObjectReference akSpeakerRef, bool abHasBeenSaid)
debug.trace(self + " OnEnd " + akSpeakerRef)
OrphanageSpell.Cast(Player, Player)
Player.removeitem(Caps001, 20)
endEvent

----------------------------

 

The "Orphanage" names need to be changed of course, to the name of the new aliases and so on.

Edited by taryl80
Link to comment
Share on other sites

  • Recently Browsing   0 members

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