Jump to content

moar scripting help please :D


cabroose

Recommended Posts

hai :D

 

so, I'm trying to make an item that changes your race on consumption. the effect is being applied but the race change is not...and quite frankly i am baffuddled...thats a real word...

 

so...for your viewing pleasure...here is that script, perhaps you could shed a little light as to why this is failing so hard?

 

 

 


Scriptname z0wendigomakerscr extends ObjectReference Hidden Conditional


Race Property ArgonianRace  Auto  
Race Property ArgonianRaceWendigo  Auto  
Race Property BretonRace  Auto  
Race Property BretonRaceWendigo  Auto  
Race Property DarkElfRace  Auto  
Race Property DarkElfRaceWendigo  Auto  
Race Property HighElfRace  Auto  
Race Property HighElfRaceWendigo  Auto  
Race Property ImperialRace  Auto  
Race Property ImperialRaceWendigo  Auto  
Race Property KhajiitRace  Auto  
Race Property KhajiitRaceWendigo  Auto  
Race Property NordRace  Auto  
Race Property NordRaceWendigo  Auto  
Race Property OrcRace  Auto  
Race Property OrcRaceWendigo Auto  
Race Property RedguardRace  Auto  
Race Property RedguardRaceWendigo  Auto  
Race Property WoodElfRace  Auto  
Race Property WoodElfRaceWendigo  Auto  
Race Property CureRace Auto





Function wendigoChange(Actor Target)


	if (Target.GetActorBase().GetRace() == ArgonianRace)
	CureRace = ArgonianRace
	Target.SetRace(ArgonianRaceWendigo)
elseif (Target.GetActorBase().GetRace() == BretonRace)
	CureRace = BretonRace
	Target.SetRace(BretonRaceWendigo) 
elseif (Target.GetActorBase().GetRace() == DarkElfRace)
	CureRace = DarkElfRace
	Target.SetRace(DarkElfRaceWendigo) 
elseif (Target.GetActorBase().GetRace() == HighELfRace)
	CureRace = HighELfRace
	Target.SetRace(HighELfRaceWendigo) 
elseif (Target.GetActorBase().GetRace() == ImperialRace)
	CureRace = ImperialRace
	Target.SetRace(ImperialRaceWendigo) 
elseif (Target.GetActorBase().GetRace() == KhajiitRace)
	CureRace = KhajiitRace
	Target.SetRace(KhajiitRaceWendigo) 
elseif (Target.GetActorBase().GetRace() == NordRace)
	CureRace = NordRace
	Target.SetRace(NordRaceWendigo) 
elseif (Target.GetActorBase().GetRace() == OrcRace)
	CureRace = OrcRace
	Target.SetRace(OrcRaceWendigo) 
elseif (Target.GetActorBase().GetRace() == RedguardRace)
	CureRace = RedguardRace
	Target.SetRace(RedguardRaceWendigo) 
elseif (Target.GetActorBase().GetRace() == WoodElfRace)
	CureRace = WoodElfRace
	Target.SetRace(WoodElfRaceWendigo) 
endif





EndFunction

 

 

 

as you can see...this is pretty much just ripped out of the vampire quest script, which sums up my knowledge of papyrus :P

 

I would very much appreciate it if i could get a little/lot of help getting this douche working...its pretty much the last hurdle of my mod i think (hope)

 

much advanced love

cab :D

Link to comment
Share on other sites

Silly question here, but you did remember to right-click on the script in CK and assign values to all the properties? Sometimes I forget and then can't figure out why the script compiles but doesn't work like expected :rolleyes:

Also, how are you calling the function wendigoChange()? I presume the item that is consumed will have a script on it that calls this function via an OnActivate() event or something?

Link to comment
Share on other sites

Silly question here, but you did remember to right-click on the script in CK and assign values to all the properties? Sometimes I forget and then can't figure out why the script compiles but doesn't work like expected :rolleyes:

Also, how are you calling the function wendigoChange()? I presume the item that is consumed will have a script on it that calls this function via an OnActivate() event or something?

 

 

:) thanks for responding :)

 

i am assigning the values to the properties okay, and as for how i'm calling it...this script is on the object itself, i thought that would be less hassle ><

 

okay....so i have been bashing my head against it some more, and noticed something i failed to notice previously, the setrace() only works on NPC's

 

I've added a Game.DisablePlayerControls() to the function (as well as the opposite)

 

but trying to call the function gives me an error about target not being specified.

 

commense pain in the arse mode...

 

 

 

Scriptname z0wendigomakerscr extends ObjectReference Hidden Conditional


Race Property ArgonianRace  Auto  
Race Property ArgonianRaceWendigo  Auto  
Race Property BretonRace  Auto  
Race Property BretonRaceWendigo  Auto  
Race Property DarkElfRace  Auto  
Race Property DarkElfRaceWendigo  Auto  
Race Property HighElfRace  Auto  
Race Property HighElfRaceWendigo  Auto  
Race Property ImperialRace  Auto  
Race Property ImperialRaceWendigo  Auto  
Race Property KhajiitRace  Auto  
Race Property KhajiitRaceWendigo  Auto  
Race Property NordRace  Auto  
Race Property NordRaceWendigo  Auto  
Race Property OrcRace  Auto  
Race Property OrcRaceWendigo Auto  
Race Property RedguardRace  Auto  
Race Property RedguardRaceWendigo  Auto  
Race Property WoodElfRace  Auto  
Race Property WoodElfRaceWendigo  Auto  
Race Property CureRace Auto



function wendigochange (actor target)

Game.DisablePlayerControls()

    if (Target.GetActorBase().GetRace() == ArgonianRace)
               CureRace = ArgonianRace
               Target.SetRace(ArgonianRaceWendigo)
       elseif (Target.GetActorBase().GetRace() == BretonRace)
               CureRace = BretonRace
               Target.SetRace(BretonRaceWendigo) 
       elseif (Target.GetActorBase().GetRace() == DarkElfRace)
               CureRace = DarkElfRace
               Target.SetRace(DarkElfRaceWendigo) 
       elseif (Target.GetActorBase().GetRace() == HighELfRace)
               CureRace = HighELfRace
               Target.SetRace(HighELfRaceWendigo) 
       elseif (Target.GetActorBase().GetRace() == ImperialRace)
               CureRace = ImperialRace
               Target.SetRace(ImperialRaceWendigo) 
       elseif (Target.GetActorBase().GetRace() == KhajiitRace)
               CureRace = KhajiitRace
               Target.SetRace(KhajiitRaceWendigo) 
       elseif (Target.GetActorBase().GetRace() == NordRace)
               CureRace = NordRace
               Target.SetRace(NordRaceWendigo) 
       elseif (Target.GetActorBase().GetRace() == OrcRace)
               CureRace = OrcRace
               Target.SetRace(OrcRaceWendigo) 
       elseif (Target.GetActorBase().GetRace() == RedguardRace)
               CureRace = RedguardRace
               Target.SetRace(RedguardRaceWendigo) 
       elseif (Target.GetActorBase().GetRace() == WoodElfRace)
               CureRace = WoodElfRace
               Target.SetRace(WoodElfRaceWendigo) 
       endif        

        
Utility.Wait(1)
Game.EnablePlayerControls()	


       
   endFunction

event onactivate (objectreference z0wendigoflesh)
wendigochange() 


EndEvent


EndEvent

 

 

 

the error is (73,0): argument target is not specified and has no default value

Edited by cabroose
Link to comment
Share on other sites

ok, when you call wendigoChange in the OnActivate event you have to pass the target as a function parameter, so it would be something like:

 

event onactivate (objectreference z0wendigoflesh) 
wendigochange(game.GetPlayer())  
endevent

 

More correctly, it probably should be:

 

event onactivate (objectreference z0wendigoflesh) 
       wendigochange(z0wendigoflesh as Actor)  
endevent

 

EDIT: you might want to add a "debug.notification" message to the OnActivate event just so you can be sure that the script is getting called properly.

 

event onactivate (objectreference z0wendigoflesh) 
       debug.notification("[z0wendigomakerscr] -> OnActivate() has been called.")
       wendigochange(z0wendigoflesh as Actor)  
endevent

 

You could put similar debug messages in your wendigochange function to let you know that the function has been called and even which "if" statements were evaluated as "true".

 

Oh, and you seem have two "endevent" at the bottom of your script. That's one too many.

Edited by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

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