Jump to content

Starwhip

Members
  • Posts

    5
  • Joined

  • Last visited

Nexus Mods Profile

About Starwhip

Starwhip's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Ah, this has done it. Was missing this in the original script as well, it probably would have worked otherwise :P Solution for anyone coming across this thread via Google-fu: Make sure you go to where your script is attached in the Creation Kit, select it, press Properties, and fill your script-defined properties with objects from the Creation Kit.
  2. No dice. I think the issue isn't the properties or the GetItemCount function, just that the script cannot find the player properly. My ref alias for the player is currently set up like this, and is probably wrong. The script extends ReferenceAlias, calls objectReference playerRef = self.GetReference(), and then uses playerRef for future calls. I tested Game.GetPlayer() as a substitute but that does not work either.
  3. Compiled this script to a new quest with the player alias, it runs the counter at least. The check for item count does not work, and I have the spell section commented out for the moment. I've tried making the initial declaration ObjectReference instead of Flora, and I've tried removing the cast to Form in GetItemCount(). Do I need to set something up outside of the script for the item checks and spell casting to work?
  4. Yeah, thinking it over I think I might be able to tie it to a quest or set of quests: Counter script updates, sets quest stage. That triggers another script to read player inventory and bump quest stage further based on the result. Final quest stage will fire a script to do the desired actions before setting the quest back to the starting stage, and since the counter will keep going it should be a continuous loop. EDIT: In this case, the counter script doesn't need to track anything itself, it will just act as the method of moving the whole "program" along
  5. I have a good amount of programming experience outside of Papyrus so I have a decent idea of what I want to do, just not how I want to do it: I'm looking to create a script/program/series of scripts that periodically increments a counter and causes the player to cast a spell upon reaching a threshold, resetting the counter to zero, and continuing. Certain basic items in player inventory will cause the counter to increment faster. What I have working so far: While it's not super pretty and I'm sure breaks a lot of modding convention, I set up a quest to start the script on a new game. It calls RegisterForSingleUpdate, and on the OnUpdate Event, It increments the counter and then calls for another update. What I haven't been able to get working: From what I can tell, I can't have this particular script check for items or cast spells because the script would have to extend ObjectReference for the former or something else I haven't researched for the latter. It currently extends Quest in order to run on game creation. Basically my code looks like this right now: ScriptName Blah extends Quest ObjectReference Property MountainFlower01Blue auto Event OnInit() RegisterForSingleUpdate(10) EndEvent Event OnUpdate() Debug.Notification(Game.GetPlayer().GetItemCount(MountainFlower01Blue)) RegisterForSingleUpdate(10) EndEvent If I can do this, what am I doing wrong? Any solutions/tips would be appreciated. Will I need several scripts managing these things somehow? Is this possible in Papyrus? Have I just missed something glaringly obvious since it's 2am? :mellow:
×
×
  • Create New...