Counting vampires killed with a specific weapon

Post » Sat Nov 17, 2012 4:58 am

So I need a function in the second quest that handles the variable and arithmetic and then the first quest simply needs to cast to it to trigger the second quest right? That's how I'm understanding it at least, and how I'm trying it for the next little while. :)

Thanks for the continued assistance Ingenue
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Sat Nov 17, 2012 1:31 am

The first quest needs to cast to it to call the function in the second quest. Your second quest needs to be running already.
User avatar
Christie Mitchell
 
Posts: 3389
Joined: Mon Nov 27, 2006 10:44 pm

Post » Fri Nov 16, 2012 11:52 pm

Ok, here is where I am at; My first quest, which determines if a vampire has been killed now has the following script;
Spoiler

Scriptname LoDVampKillCount extends Quest ConditionalQuest Property LoDDepositBoxQuest  Auto  ConditionalInt Property LoDKillCount  Auto  ConditionalFunction IncreaseKillCount()LoDKillCount = LoDKillCount + 1EndFunction

I'm having trouble calling my function, the compiler tells me that LodIncreaseKillCount is not a function, here is my fragment:

Spoiler
if alias_KillerAlias.GetReference() == Game.GetPlayer()IncreaseKillCount().LoDKillCount(0)endifstop()

Am I not calling the function correctly? Or is my function wrong? Or am I still not understanding any of this at all? :tongue:
I have my second quest set up with that same script attached to it, it's always running, so the first quest should not be resetting the variable right?

Edit: My function compiles correctly so I guess I'm just not calling it correctly in the fragment, though I'm doing it as the wiki describes, at least I think I am. : /

Edit the second: I think I figured it out! kmyQuest.IncreaseKillCount() compiles, now I can test and see if it's working!

Edit the third: Everything is working besides the count which now just never climbs higher than 1, I noticed I also had the Quest property as only the quest script name so I changed it to "Quest Property LoDDepositBox).IncreaseKillQuant() Auto" but it won't compile this way. Ah, this is so confusing!

This is the compilers angry tears.
Spoiler
Starting 1 compile threads for 1 files...Compiling "QF_LoDTrackerQuest_01000D69"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,28): no viable alternative at input ')'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,55): mismatched input '\\r\\n' expecting STATEc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_LoDTrackerQuest_01000D69.psc(19,35): cannot cast a quest to a lodvampkillcount, types are incompatiblec:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,28): no viable alternative at input ')'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,55): mismatched input '\\r\\n' expecting STATEc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,28): no viable alternative at input ')'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,55): mismatched input '\\r\\n' expecting STATEc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,28): no viable alternative at input ')'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,55): mismatched input '\\r\\n' expecting STATEc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,28): no viable alternative at input ')'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\LoDVampKillCount.psc(3,55): mismatched input '\\r\\n' expecting STATENo output generated for QF_LoDTrackerQuest_01000D69, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on QF_LoDTrackerQuest_01000D69

Would using globals save me hassle here? If so could someone explain how to modify global variables to my simple little brain? The Wiki is very confusing about them and nothing I've tried with globals gets past the compiler. Bleh.
User avatar
Stacyia
 
Posts: 3361
Joined: Mon Jul 24, 2006 12:48 am

Post » Sat Nov 17, 2012 5:21 am

I've gotten my global modifying script past the compiler and I'm able to reference the global in a debug.notification to see it in-game, it only ever shows up as 0 however.
Here is how I have my function right now:
Function IncLoDGlobal()LoDKillGlobal.Mod(0)EndFunction

And I've just noticed I'm modding it by 0, herr derr, brb I guess.

Edit: Waaah, modding it still doesn't increase it, I've also tried LoDKillGlobal.SetValue((LoDKillGlobal.GetValue() as int)+1) still nothing, I don't get why the global won't increase. : /

Edit: HOLY BALLS IT'S WORKING! I scrapped casting, since I'm working with globals now and I don't need to do that, now simply having LoDKillCount.SetValueInt((LoDKillCount.GetValue() as int)+1) inside of my fragment makes it wooooooork!

Now it's time to scrap this plugin and remake it with none of the useless, most likely game-breaking-at-some-point additions I've made!

Thanks for all the help so far guys, hopefully my next post will be something other than OMGITDOESN'TWORKANYMORE.

In the interest of anyone trying to do something like this in the future, the following is everything done so far:
Spoiler

- I've created a global with a value of 0 and called it "LoDVampsKilled".
- I've made my weapon and named it "LoDSword"
- I've Created a quest called LoDTrackerQuest, changed event to Kill Actor Event, and unticked Run Once, and then created one stage of 0, ticked Start up and Shut down and made an empty ENTRY.
- Created two Alias', the first "VictimAlias" with fill type as Find Matching Reference, from event, KillActor. Then Event Data, Victim. And set Match conditions for each vampire race.
- The second Alias I've named "KillerAlias" identical to victim with the exception of Event data which is set to Killer, and conditions which there is 1, GetEquipped with "LoDSword" specified.
- Now on stage 0 of my quest I've made a new property in Papyrus Fragment, it's type is Global, I've named it "LoDVampsKilled" and then set it's value to my Global of the same name.
- Entered the following into fragment:
if alias_KillerAlias.GetReference() == Game.GetPlayer()LoDKillCount.SetValueInt((LoDKillCount.GetValue() as int)+1)Debug.Notification(LoDKillCount.GetValueInt())endifstop()
-And assuming I haven't forgotten everything, it works! And hopefully if anyone needed this, I've saved some time.
User avatar
x a million...
 
Posts: 3464
Joined: Tue Jun 13, 2006 2:59 pm

Previous

Return to V - Skyrim