script spawning dragons & counting their deaths

Post » Tue Jun 19, 2012 9:08 pm

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment

;NEXT FRAGMENT INDEX 3
Scriptname QF_AEZFortressSteward01_02015EC9 Extends Quest Hidden
;BEGIN ALIAS PROPERTY Steward
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Steward Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY target
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_target Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY DragonSpawn
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DragonSpawn Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY Target4
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Target4 Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY Target2
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Target2 Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY Target3
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Target3 Auto
;END ALIAS PROPERTY
;BEGIN ALIAS PROPERTY Target5
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Target5 Auto
;END ALIAS PROPERTY
;BEGIN FRAGMENT Fragment_2
Function Fragment_2()
;BEGIN CODE
SetObjectiveCompleted(100)
SetObjectiveDisplayed(200)
Game.GetPlayer().AddItem(Gold001, 2500)
SetObjectiveCompleted(200)
SetStage(0)
;END CODE
EndFunction
;END FRAGMENT
;BEGIN FRAGMENT Fragment_1
Function Fragment_1()
;BEGIN CODE
SetObjectiveCompleted(10)
SetObjectiveDisplayed(100)
;END CODE
EndFunction
;END FRAGMENT
;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
SetObjectiveDisplayed(10)
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
MiscObject Property Gold001 Auto
User avatar
Kayleigh Williams
 
Posts: 3397
Joined: Wed Aug 23, 2006 10:41 am

Post » Tue Jun 19, 2012 9:08 pm

Scriptname FortressBountyAezScript extends ObjectReference

Quest Property FortressBountyQuest Auto
Int DragonDeaths
Event OnDeath(Actor killer)
DragonDeaths = DragonDeaths + 1
If DragonDeaths == 5
FortressBountyQuest.SetStage(100)
DragonDeaths = 0
elseif DragonDeaths == 1
Debug.MessageBox("One!")
elseif DragonDeaths == 2
Debug.MessageBox("And two!")
elseif DragonDeaths == 3
Debug.MessageBox("DIEEEEE")
elseif DragonDeaths == 4
Debug.MessageBox("Just one left")
Else
EndIf
EndEvent
User avatar
Carlitos Avila
 
Posts: 3438
Joined: Fri Sep 21, 2007 3:05 pm

Post » Tue Jun 19, 2012 6:49 pm

I have these 2 scripts, the first one is the quest script, the second is on each of the dragons (target and target2-5). When speaking with a person I want the 5 dragons to spawn and when I kill them I want it to count till there are 5 and then set the next stage in my mission (collect reward).

- Problems

1. I've made the dragons aliasses that are spawned (create encdragonbounty at dragonspawn) but they are already there before I speak to my steward to actually start the quest.
2. each dragon only gives the first message -> so no mission progression.

What should be changed?
User avatar
I’m my own
 
Posts: 3344
Joined: Tue Oct 10, 2006 2:55 am

Post » Tue Jun 19, 2012 3:38 pm

The answer to your first problem with the spawning dragons is they start enabled. Set them each to disabled and enable them via script when your quest starts.

The answer to the second part is your counter DragonDeaths is in the script, so there is a seperate copy for each dragon, which is why it does not progress. You need to create a global variable to track the quest progress and modify that global variable in your scripts rather than the local variables which do not interact across objects.
User avatar
laila hassan
 
Posts: 3476
Joined: Mon Oct 09, 2006 2:53 pm

Post » Tue Jun 19, 2012 3:51 pm

about the first part: I tried that; I created a marker and 5 dragons all disabled with the marker as their parent. WHen compling the enable script (in quest) it gave errors (said the target couldn't be enabled). Then I thought that even if it worked it would mean the dragons are gone. and I want the quest to be able to start over again (like other bounty quests) in conversation. SO when I saw an option to "create references at " in the alias script I thought that was what I would need. (the dragons aren't placed in the reference window so I can't disable them there, they aren;t there).

about the second part: how do I do this?
User avatar
Horror- Puppe
 
Posts: 3376
Joined: Fri Apr 13, 2007 11:09 am

Post » Tue Jun 19, 2012 10:41 pm

I tried to set a condition (stage == 10) on the spawning dragons.
That helped in a way: the dragons are not there anymore, only now I can't speak with my steward anymore.

On globals: I can only fin text about global value's that seem to imply existing things like time etc etc. How do you set a NEW global value (DragonDeaths). I think I could work with the commands I found to set and get that value once I created it.
User avatar
Kelly John
 
Posts: 3413
Joined: Tue Jun 13, 2006 6:40 am

Post » Tue Jun 19, 2012 11:41 pm

Look on the wiki under the Text Replacement article (http://www.creationkit.com/Text_Replacement) for information about how to est up global counters for quests and display updates like the fetch quests in the game do.

I believe what Bethesda does to spawn actors for quests is to place an encounter marker where they want the actor to spawn (http://www.creationkit.com/Bethesda_Tutorial_Encounters). I believe you can set this marker as disabled until you want it to spawn, at which point you can enable it and the actor spawns. At least that worked in Fallout 3.

I'm not sure how to reset encounters so that they are repeatable. I know you can reset cells so that the encounters in a dungeon reset, for example, but that may not be helpful to you.
User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am

Post » Tue Jun 19, 2012 10:32 am

Ow this is getting hard. If there are anymore suggestions on both points I'd be grateful. ATM I'm also stuck in the DragonDeaths counting.
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Tue Jun 19, 2012 3:02 pm

Ok I found a tutorial and it looks nice, but I'm still getting an error. I guess there is one last line (the tutorial sadly skip parts they aren't explaining even though I don't know how to correctly use them; for anyoen makin tutorial: plz post whole scripts).

I also looked at the destroyDB quest to solve my problem and they handle it differently. I'll try to get this method to work ifanyone of you can help me.

This: http://www.creationkit.com/Safely_increment_variable_from_multiple_scripts is the tutorial

These are my scripts:

The Quest script:

[size=6]Scriptname AEZdragondeathsQuestscript extends QuestInt Property TotalDragons autoInt Property DragonDeaths autofunction IncrementDragonDeaths()DragonDeaths = Dragondeaths + 1if DragonDeaths >= TotalDragonssetStage(100)elseif (DragonDeaths == 1)Debug.MessageBox("One!")elseif (DragonDeaths == 2)Debug.MessageBox("And two!")elseif (DragonDeaths == 3)Debug.MessageBox("DIEEEEE")elseif (DragonDeaths == 4)ebug.MessageBox("Just one left")ElseEndIfendFunction[/size]

and this is the on reference script:

[size=6]Scriptname AEZDragonDeath01script extends ReferenceAliasQuest Property myQuestScript AutoEvent OnDeath(); increment dead countmyQuestScript = GetOwningQuest() as AEZdragondeathsQuestscriptmyQuestScript.IncrementDragonDeaths()endEvent[/size]


the last one doesn't compile

Starting 1 compile threads for 1 files...
Compiling "AEZDragonDeath01script"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\AEZDragonDeath01script.psc(8,29): IncrementDragonDeaths is not a function or does not exist
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\AEZDragonDeath01script.psc(5,0): the parameter types of function ondeath in the empty state on script aezdragondeath01script do not match the parent script referencealias
No output generated for AEZDragonDeath01script, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on AEZDragonDeath01script


 
User avatar
BaNK.RoLL
 
Posts: 3451
Joined: Sun Nov 18, 2007 3:55 pm

Post » Tue Jun 19, 2012 1:22 pm

I would approach this very differently myself.
Say the stage of the quest where you fight the dragons is 10 and the stage where you have killed all the dragons is 20.
I would make stages 12,14,16,18. For each time there's an OnDeath even from one of the dragons you increment the quest to the next stage. When it's the 5th dragon you increment to stage 20.

This might not be the slickest most ideal solution but it's simple and I'm pretty sure it will work ;)
User avatar
Mari martnez Martinez
 
Posts: 3500
Joined: Sat Aug 11, 2007 9:39 am

Post » Tue Jun 19, 2012 3:59 pm

\temp\AEZDragonDeath01script.psc(8,29): IncrementDragonDeaths is not a function or does not exist - This means that your function is not in the scope of your script. You need to link the two scripts together... How do to this? I am not sure at the moment. I am sure someone here does. It would most likely be adding some sort of reference to the quest and then using it in there, or by importing it through other means.

Didnt reallize you tried doing that already.

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\AEZDragonDeath01script.psc(5,0): the parameter types of function ondeath in the empty state on script aezdragondeath01script do not match the parent script referencealias - This means that your OnDeath() parameters do not match the event parameters. Change it to
Event OnDeath(Actor akKiller)
and it will fix your issue.
User avatar
Jessie Rae Brouillette
 
Posts: 3469
Joined: Mon Dec 11, 2006 9:50 am

Post » Tue Jun 19, 2012 1:24 pm

Severed Skullz: you where right, that solved that line.

Which leaves me with:

Starting 1 compile threads for 1 files...
Compiling "AEZDragonDeath01script"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\AEZDragonDeath01script.psc(8,29): IncrementDragonDeaths is not a function or does not exist
No output generated for AEZDragonDeath01script, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on AEZDragonDeath01script

any idea how to solve that issue?
User avatar
Anna Kyselova
 
Posts: 3431
Joined: Sun Apr 01, 2007 9:42 am

Post » Tue Jun 19, 2012 6:11 pm

PS dudster I might try your method, but there would still need to be some sort of way to keep track of how many died I guess or I'd need to do a lot of if-ing (which might work).

but since i'm only one error away from a working script I'll see if anyone can solve that last problem.
User avatar
Sarah Bishop
 
Posts: 3387
Joined: Wed Oct 04, 2006 9:59 pm

Post » Tue Jun 19, 2012 10:56 pm

Meh. Another thing you could do is use the Referenced Aliases...
Spoiler
[img]http://www.creationkit.com/images/8/8d/FilledFirstAliasWindow.png[/img]
User avatar
Kayla Bee
 
Posts: 3349
Joined: Fri Aug 24, 2007 5:34 pm

Post » Tue Jun 19, 2012 4:06 pm

I am using those already, I've created 5 aliases, each the same dragon (a copy I made) each of them is supposed to have that 2nd script that is not resolving the on with ondeath in it (it extends referencealias as you can see).

It seems it can't find the function ( that is in the other script) so it might be that my linking of the script on the reference is incorrect, and that might be it since I'm finding that part of scripting especially difficult.
User avatar
Ezekiel Macallister
 
Posts: 3493
Joined: Fri Jun 22, 2007 12:08 pm

Post » Tue Jun 19, 2012 4:12 pm

Any new imput?
User avatar
Adrian Morales
 
Posts: 3474
Joined: Fri Aug 10, 2007 3:19 am


Return to V - Skyrim

cron