Jump to content

Adding a note with players name and sex to a bandit


tonycubed2

Recommended Posts

Hi,

 

I need to have some assassins carry a note so it can be read by plaer when dead. Easy so far. I made teh toons, added the note in the ckit. But for immersion, I need the players name to appear as well as his gender. I found this note that had what I wanted, which I post here:

 

<p align="left">

</p>

 

<Alias=Player>

 

<font face='$HandwrittenFont'>Be on the look out for the <Alias.Race=Player> called <Alias=Player>. <Alias.Pronoun=Player> is an enemy to the Thalmor, and has actively disrupted our activities and caused great harm. If spotted, you are to destroy <Alias.PronounObj=Player> with extreme hatred.

 

Be advised, <Alias.Pronoun=Player> is extremely dangerous, and quite able to defend <Alias.PronounRef=Player>. If caught by local authorities, we are unable to offer you any assistance.

 

For the glory of the Aldmeri Dominion!</font>

 

 

But using just the place holders do not work.

 

I found that the note is attached to a quest and the place holders are deffined as reference aliases. Makes sense. I tried to duplicate that. But My toons are not part of any quest, I spawn random actors in mY mod Sands of Time. Once spawned they are on auto. I did try to duplicate the same technique by creating the reference alias in my walking encounters quest, and then tired to use it in my assassins script by referring to the reference alias in the script, as such:

 

Scriptname sot_assaboss extends Actor 

import Actor


Event OnDeath(Actor akKiller)
self.AddItem(letter, 1, true)
endevent

ReferenceAlias Property Contract  Auto  

ReferenceAlias Property Letter  Auto  

 

But it will not compile. gives the following errors:

 

Compiling "sot_assaboss"...

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\sot_assaboss.psc(7,5): type mismatch on parameter 1 (did you forget a cast?)

No output generated for sot_assaboss, compilation failed.

 

 

And then I tried casting it as a MiscObject but that does not work, says types incompatible.

 

I could make it work if it was a normal quest scenario with premade actors, but my toons are created on the fly as the game progresses...

 

Help!

Link to comment
Share on other sites

1) Don't import Actor in a script that extends Actor (it's redundant).

2) AddItem will add an ObjectReference to your inventory, but "letter" is a ReferenceAlias. You need to get the ObjectReference that the alias is pointing at by using GetRef().

3) You don't need the Contract property, you haven't used it for anything in the script.

 

Scriptname sot_assaboss extends Actor 

ReferenceAlias Property Letter  Auto

Event OnDeath(Actor akKiller)
ObjectReference myLetter = letter.GetRef()
AddItem(myLetter, 1, true)
endevent

 

Edit: See here for info on how to use Text Replacement.

 

You'll need to create a basic Quest then add an alias called "Player" that points to you-know-who, plus another alias called "letter" that points to your note.

Edited by steve40
Link to comment
Share on other sites

ok, I made changes, everything compiles great but no note is passed to dying boss: Here is a screen capture of all relevant settings that may help:

note: the assassin has a script that runs upon death. It is not part of the quest where the lias is deffined. Maybe that is the problem and the requirement? Would be a deal breaker as I have a separate script for spawning encounters and it does not use quest stages or quest fragments. Hmm. Let me post a pic of the code that spawns the Assassin in case it helps.

 

http://img715.imageshack.us/img715/2159/refalias.jpg

 

 

Scriptname sot_assaboss extends Actor   
 
 
Event OnDeath(Actor akKiller)  
       ObjectReference myLetter = letter.GetRef()  
       AddItem(myLetter, 1, true)  
endevent  
 
 
 
 
MiscObject Property Gold  Auto    
 
ReferenceAlias Property Letter  Auto  

 

Assassin supposed to get note:

 

http://img853.imageshack.us/img853/3419/picture2ko.jpg

Link to comment
Share on other sites

Here is the script that spawns my assassins: You will a couple of things remarked that I was trying earlier:

 

If  IsTimeValid() && RandomInt() > SpawnOdds2 && RandomInt() > SpawnOdds && !Game.GetPlayer().IsInFaction(DarkB) && RandomInt() > Frosty.getvalueint() && LoreState == 0
attackers = 1
whereA1 = Utility.RandomFloat(-1800,1800)
whereA2 = Utility.RandomFloat(-1800,1800)
whereB1 = Utility.RandomFloat(-1800,1800)
whereB2 = Utility.RandomFloat(-1800,1800)
whereC1 = Utility.RandomFloat(-1800,1800)
whereC2 = Utility.RandomFloat(-1800,1800)
whereD1 = Utility.RandomFloat(-1800,1800)
whereD2 = Utility.RandomFloat(-1800,1800)
Target1.MoveTo(Game.GetPlayer(),whereA1,whereA2,0)
Target2.MoveTo(Game.GetPlayer(),whereB1,whereB2,0)
Target3.MoveTo(Game.GetPlayer(),whereC1,whereC2,0)
Target4.MoveTo(Game.GetPlayer(),whereD1,whereD2,0)
if messages.getvalueint() == 5
Debug.Notification("Assassins!")	
EndIf
Utility.Wait(2)
Target1.PlaceActorAtMe(DarkBrother1, 4).StartCombat(Game.GetPlayer())
;DarkBrother1.AddItem(DeathNote, 1, true)
;dudeInstance = Game.GetPlayer().PlaceActorAtMe(sanddude,1)
if RandomInt() > 50
if messages.getvalueint() == 5
Debug.Notification("I Am Ambushed!!")
EndIf
Utility.Wait(2)
Target2.PlaceActorAtMe(DarkBrother2, 4).StartCombat(Game.GetPlayer())
EndIf
if RandomInt() > 50
if messages.getvalueint() == 5
Debug.Notification("Dark Brotherhood Attacks!")
EndIf
Utility.Wait(2)
Target3.PlaceActorAtMe(DarkBrother2, 4).StartCombat(Game.GetPlayer())
EndIf
if RandomInt() > 60
if messages.getvalueint() == 5
Debug.Notification("Cold Blooded Assassins!")
EndIf 
 Utility.Wait(2)
Target4.PlaceActorAtMe(DarkBrother3, 4).StartCombat(Game.GetPlayer())
EndIf

EndIf
;end dark brotherhood

Link to comment
Share on other sites

I could be wrong, but I don't believe you can get the note to spawn properly with that method if you're also trying to use stored text. Instead of using a separate script to handle the note, it may work in your "Create Reference to Object" if you select "Create In" and then select your NPC's reference alias (e.g., your Assassin Boss). Note that I'm assuming that you want the note to spawn in the Assassin Boss' inventory.
Link to comment
Share on other sites

"Hmmm But there is no reference alias for the Assassin Boss since he is spawned as needed by my Walking Encounter script. If I try to add a reference alias in the same quest as the note/letter I cannot pick Assassin Boss from the list. I nopticed there is a "unique" button I can use to refer to npcs. I could go to the npc properties and click on "unique" but since he gers reused over and over is there a bad effect caused by that?

edit: the unique button is greyed out in any case

 

The following did not work either, though it compiles:

 

Actor Bossman 

;test 
whereA1 = Utility.RandomFloat(-1800,1800)
whereA2 = Utility.RandomFloat(-1800,1800)
whereB1 = Utility.RandomFloat(-1800,1800)
whereB2 = Utility.RandomFloat(-1800,1800)
whereC1 = Utility.RandomFloat(-1800,1800)
whereC2 = Utility.RandomFloat(-1800,1800)
whereD1 = Utility.RandomFloat(-1800,1800)
whereD2 = Utility.RandomFloat(-1800,1800)
Target1.MoveTo(Game.GetPlayer(),whereA1,whereA2,0)
Target2.MoveTo(Game.GetPlayer(),whereB1,whereB2,0)
Target3.MoveTo(Game.GetPlayer(),whereC1,whereC2,0)
Target4.MoveTo(Game.GetPlayer(),whereD1,whereD2,0)
Bossman = Target1.PlaceActorAtMe(DarkBrother1, 4).StartCombat(Game.GetPlayer())
MyLetter = Deathnote.GetRef()
Bossman.AddItem(MyLetter, 1, true)

;end of test

Link to comment
Share on other sites

ok, I made changes, everything compiles great but no note is passed to dying boss:

 

An alternative option would be to add the note as a "death item" in the boss' (Darkbrother1) configuration. I think it's an option in the Actor form iirc.

Edited by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

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