Jump to content

I am getting depressed


bboban13

Recommended Posts

Hi to everyone .

 

I wanna make a mod ! (like you haven't hear that before)

After roughly 10 hours , depression for not being able to setup easiest thing kicked in ......

 

I want to talk to character , and then I want script to start , giving me a perk (beacause I'm such a good guy !)

 

So here is what I've done :

 

Made quest - check

made dialog inside the quest - check

given quest dialog condition so only my favorite blacksmith ALVOR is able to say it. After many spent hours getting this simple stuff to work , the basterd finally says the line : "let me give you this awesome perk ! "

 

now here lies the problem . I compiled the script and attached it to that line which I choose in dialogue :

 

 

 

Scriptname giveperk extends TopicInfo

 

;Scriptname giveperk extends ObjectReference (tried both of these)

 

Perk property Armsman00 auto

 

State Running

 

Event OnBeginState()

debug.messagebox("bob")

if Game.GetPlayer().HasPerk(Armsman00) == False

Game.GetPlayer().AddPerk(Armsman00)

Debug.MessageBox("You have learned the perk: " + Armsman00 )

else

Debug.MessageBox("You have already learned this perk.")

endif

 

EndEvent

EndState

 

 

suprise suprise , ALVOR just says the lines but doesn't "walk the talk" .....

Please HELP! Dont' make me work out my frustration by destroying ALVOR 100 times in a row !

Link to comment
Share on other sites

I haven't used the CK for dialog yet but i know the oblivion one let you execute scripts on a dialog line. Why don't you try placing it there. That is, if you're not getting any of those debug lines. Alternatively I think you could place the script in as a quest step and then just increment the quest phase to that point. GL
Link to comment
Share on other sites

I've only scratched dialogue scripting, but one thing that jumps out is the lack of "fragment" functions. The line the npc should say has two scripting boxes below it, Begin and End as well as a section to attach scripts to the right of that. Begin code will run when the npc speaks and End will run when they're done speaking. Assuming you have no scripts attached to the topic info, adding anything to either Begin or End and then hitting Compile will automatically generate a "TIF__0#######.psc" script (which can be renamed in the advanced tab). If you renamed the script to "giveperk" (careful with very generic names), it would look something like:

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 2
Scriptname giveperk Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE

; Topic Info Begin

;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_1
Function Fragment_1(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE

; Topic Info End
debug.messagebox("bob")
if  Game.GetPlayer().HasPerk(Armsman00) == False
	Game.GetPlayer().AddPerk(Armsman00) 
	Debug.MessageBox("You have learned the perk: " + Armsman00 )
else
	Debug.MessageBox("You have already learned this perk.") 
endif

;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Perk property Armsman00 auto

Bethesda_Tutorial_Dialogue

Edited by Ez0n3
Link to comment
Share on other sites

Well firstly, why have you uses a STATE? It's not even an auto state, so it won't even run unless directed to by another piece of code.

Secondly, even it if were an auto state, OnBeginState() does not apply to auto states.

Thirdly, I've never seen a script that extends topicinfo, in fact, there is only 1 Papyrus function supported by the TopicInfo script, and you don't even use it.

You need to rethink your scripting approach.

 

As pointed out above, you should simply add a topicinfo fragment like this:

 

debug.messagebox("bob")
if !Game.GetPlayer().HasPerk(Armsman00)
Game.GetPlayer().AddPerk(Armsman00) 
Debug.MessageBox("You have learned the perk: " + Armsman00 )
else
Debug.MessageBox("You have already learned this perk.") 
endif

 

Then manually create the perk property using the Properties button.

Then compile it. Then the compiled fragment should look similar to what Ez0n3 posted above.

Edited by steve40
Link to comment
Share on other sites

Ok guys, thanks for your replies .

 

to Ez0n3 - I managed to attach this script that you gave to the dialogue , actually , and compile went smoothly . But , script doesn't run when I run dialogue in game , none of debug messages show . That's why I tried to use lines

 

State Running

Event OnBeginState()

 

even without knowing what they are doing by hoping it would force the script to run . I even tried to produce debug message only , no luck . I manged to compile without errors but it seems that for some reason scripts are not running .

Any help would be appreciated , or even testing the code you gave me - I know it's a lot to ask , especially from noob modder but hey - my teachers thought me that there are no stupid questions :)

 

to steve40 - little tough love approach from you - I like it ! Seriously , I am new to modding so my questions are bound to have some naive mistakes but I'll keep them to a minimum . Actually, I managed to do your approach to and it produced mostly same code as Ez0n3's but result is , I'm afraid , the same as above .... also , any further advice will be appriciated.

 

Thanks again, Guys

Link to comment
Share on other sites

  • Recently Browsing   0 members

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