Jump to content

ripvanwinkle111

Premium Member
  • Posts

    118
  • Joined

  • Last visited

Posts posted by ripvanwinkle111

  1. Well, the script is attached directly to the npc so I have no clue why it won't work.

     

    Both of these lines don't compile.

     

    debug.messagebox("NPC isdead? = "+(self as Actor).isdead() )

    debug.messagebox("NPC isdead? = "+self.isdead() )

     

    I tried it your way, but once I have that bool, I can't get it to make a function call back to let the NPC know that it's dead (or store the variable).

    The first script compiles fine, but the second part says : cannot cast a actor to a MyNPCscript, types are incompatible

    I left out the part about ondeath cast spell on self.

     

    --------------Script on the NPC-------------compiles fine---------

    function amidead(Actor akTarget, Actor akCaster)

    debug.messagebox("Am I dead? = "+akTarget.isdead())

    endfunction

    -----------------------------------------------------

     

    ----------------Script on the magiceffect---------------doesn't compile----------

    Event OnEffectStart(Actor akTarget, Actor akCaster)

    if (akTarget.IsDead())

    npcdead = true

    (akCaster as MyNPCscript).amidead(akTarget,akCaster)

    endif

     

    EndEvent

    ---------------------------------------------------

     

    EDIT: Ok, I figured it out, my problem is that I took the default setting when adding a script.

     

    The default when adding a script to an NPC is ObjectReference

     

    Scriptname MyNPCscript extends ObjectReference

     

    Instead, it should be Actor

     

    Scriptname MyNPCscript extends Actor

     

    Now everything works fine.

  2. Here's an example of how you would use IsDead:

     

    Scriptname DA06GiantScript extends ReferenceAlias  
    
    Quest Property DA06  Auto  
    
    
    Event OnDeath (Actor Killer)
    
    DA06QuestScript QuestScript = DA06 as DA06QuestScript
    
    if Killer == Game.GetPlayer()
    	if DA06.GetStage() == 100
    		if Yamarz.GetActorReference().IsDead()    
    			HammerGroveScene.Start()
    		endif
    	endif
    endif    	
    
    QuestScript.GiantDead100 = 1
    Yamarz.GetActorReference().EvaluatePackage()
    DA06.SetObjectiveCompleted(100,1)
    DA06.SetObjectiveDisplayed(110,1)
    EndEvent
    ReferenceAlias Property Yamarz  Auto  
    
    Scene Property HammerGroveScene  Auto

     

     

     

    Thanks, I'll give that a try later.

     

    EDIT: Well, that didn't work either..

    Yamarz is an alias and GetActorReference() is suppsed to return an actor,

    but when I tried it, it said it is not a funtion.

     

    debug.messagebox("NPC isdead? = "+self.GetActorReference().isdead() )

     

    I also tried this, same effect.

     

    debug.messagebox("NPC isdead? = "+(self.getbaseobject() as Actor).GetActorReference().isdead() )

     

    EDIT:

     

    Well, I found part of the problem.

     

    self.getbaseobject() returns the NPC's baseid

     

    but

     

    (self.getbaseobject() as Actor) returns none.

     

    Sadly (self.getbaseobject() as Actor) is the only one that doesn't throw an error when I add .isdead()

  3. convoluted workaround for scripts that receive actor events:

    Instead of using IsDead(), try making a new bool variable and setting it in an OnDying() event.

     

    I've had issues with OnDeath() events but OnDying() always fires in my experience.

     

    example:

     

    bool ActorDead = False
    
    Even OnDying(Actor akKiller)
    
     ActorDead = True ;you can now use <if ActorDead> instead of <if IsDead()>
    
    EndEvent
    

     

    Yeah, I'm using this workaround at the moment. I still need to add another event so if the player resurrects them, then the flag is set back to false the next time the player talks to them.

     

  4. Try with an OnLoad event instead of OnInit. It seems that the onupdate event never happens so its stuck on false.

     

    Then add UnregisterForUpdate() once you checked what you wanted to check.

     

    OnLoad only triggers when you walk into that cell so that won't work if the NPC dies while helping you against a bandit attack.

     

    And the onupdate event does fire for me, I get a new messagebox every 5 seconds.

  5. An actor property doesnt works?

     

    Papyrus has string type, check the wiki.

     

    Anyway, you're not looking for the baseID of the actor, you're looking for the referenceID. Give it one in the render window, checking the properties of the actor in that cell, then point from the property to the actor.

     

    Where are you running the script? from a quest? actor? activator? what?

     

    Passing a bool into a string isn't the problem, the problem is that the return value is always false.

     

    Yep, already tried giving it the referenceid, it doesn't work.

    The script is attached to the NPC itself.

     

    Self.isdead() also does not work.

    Self as Actor fails.

    Self as Actorbase fails.

     

    It's very frustrating is all, trying to find the right " cast as" phrase that doesn't bomb out.

     

     

     

     

  6. Umm... Eh, i *think* you can make it work in two ways:

     

    If the script is running off the NPC, that is, the script is attached to the NPC, by just running an IsDead() without any further stuff should work.

     

    debug.messagebox("NPC IsDead? = "+(IsDead())

     

    If not, you need to make a property that points to the NPC. This one im not sure how to do it, it may be an object reference property or an actor property, whichever one lets you select the NPC from the render window.

     

    Then you'd call the IsDead like this:

     

    debug.messagebox("NPC IsDead? = "+(tehproperty.IsDead())

     

    Now, im not sure how Papyrus works like this but for all i know (not much actually) of both Ada and C++, the compiler would crap at you for trying to output a boolean as a string.

     

    So you may need to make a conditional if Papyrus doesnt makes the conversion automatically. That means, creating a string variable, assigning to it "false" or "true" depending on what IsDead() tells you with an IF, then displaying a message with the string.

     

    something like

     

    if IsDead == true

    mystring = "true"

    else

    mystring = "false"

    EndIf

     

    debug.messagebox("NPC IsDead? = "+(mystring))

     

    Or something like that. Probably its done automatically, but its worth mentioning.

     

    Well, I have tried passing the objectreference but it doesn't have the IsDead() function on it.

    As for strings, well, Papyrus doesn't have strings really. The only strings it uses is for date and gamesettings.

    With the GECK, it didn't check this kind of thing when you wrote the script, because nothing was compiled...it ran or it broke.

     

    Edit: I just tried :

     

     

    debug.messagebox("NPC IsDead? = "+IsDead())

     

    and it said its not a valid function.

     

  7. I think you're confusing GetDeadCount and IsDead. One uses the base ID, the other uses the reference ID.

     

     

    GetDeadCount returns how many of that base type is dead. So if you have killed 25 rabbits, GetDeadCount will return the integer 25.

     

    And I have tried using objectreference and Actorbase but both of those throw a compile error saying that IsDead() is not a valid function for that type.

     

    I'm just trying to find out if a specific npc is alive or dead.

     

     

    According to the wiki, it should work like this.

     

    ; Is Sally currently dead?

    bool sallyIsDead = Sally.IsDead()

     

    http://www.creationk.../IsDead_-_Actor

     

     

  8. So, I have an NPC and I want to check if he is dead, and if he is dead, prevent other functions or loops from running.

    However, the NPC state never becomes true. (npc is dead)

     

    I'm not using an integer variable in the OnDeath event because I expect people like to use console commands to resurrect NPCs.

    I just want some of my other functions to stop working unless the NPC is alive.

     

    self.getbaseobject() returns the correct base ID.

    And the compiler doesn't throw any errors.

     

    Any suggestions?

     

     

     

     

    event oninit()

    registerforupdate(5)

    endevent

     

     

    event onupdate()

     

    debug.messagebox("NPC IsDead? = "+(self.getbaseobject() as Actor).isdead())

     

    endevent

  9. In the GECK we used to be able to combine several statics to make one new unified object, but I haven't figured out how to do it in the CK.

    I have already unpacked the skyrim .bsa's and copied them to my New Vegas folder, however, when I try to make a new object, in the GECK, that points to that .nif object the textures are invisible.

    And I have quadruple checked that I have the files in the New Vegas folder.

     

    I know they are the same folder structure because I copied the entire meshes and texture folders over.

     

    Has anyone figured out how to make a SCOL in Skyrim?

    And, could you tell me how?

     

    Thanks,

  10. You can get a house for free.

    Goto the Bannered Mare In Whiterun and talk to

    Uthgerd the Unbroken.

    Challenge her to a fight. If you win, you can ask her to become your companion.

    Then, once she is your companion, look in her inventory and take her house key.

     

    Her house is across the street from Breezehome, behind the Drunken Huntsman.

    It has several containers you can use.

     

    If you put expensive items in the containers, the inventory label turns red, as if it is owned.

    But when you take the item out, it is NOT flagged as stolen.

     

    I tested this by leaving some Daedric gear and weapons in the drawers for two weeks.

     

    You can drop Uthgerd as a companion and keep her house key.

     

     

  11. original thread

     

    <br>Game setting <b>iHoursToRespawnCell</b> is the time for anything to respawn and is by default set to 72 (3 days). You'll have to be outside the cell for it to reset, including chests, etc. You can change this amount with <b>SetNumericGameSetting iHoursToRespawnCell <hours></b>. Chests don't normally have their own spawning time, but you can force it by using <b>ResetInterior <cellname></b>. This will force the cell to reset, including any chests inside it. You will have to be outside this cell to make it work though. You can also fake respawning by just adding items to chests under certain conditions.<br>

    Hmmm, I just re-read your OP and you said you already tried the respawn mods... I gues this won't help then. Sorry.

  12. If you use the removeallitems command, you are pretty much guaranteed that the NPC will revert to its default clothes.

    You have to leave one of their default items, or it will reset the entire batch.

     

    What I've had to do is remove each item , one by one, and leave either the gloves or the boots.

    Then give them the new equipment.

     

    If they don't automatically equip the new gear I have to use the 'equipitem' command for each new item.

  13. If you use the removeallitems command, you are pretty much guaranteed that the NPC will revert to its default clothes.

    You have to leave one of their default items, or it will reset the entire batch.

     

    What I've had to do is remove each item, one by one, and leave either the gloves or the boots.

    Then give them the new equipment.

     

    If they don't automatically equip the new gear I have to use the 'equipitem' command for each new item.

  14. I was in Ivarstead when some guy runs up to me and hands me a weapon. He mutters something about holding it for him before he runs off.

    Since this has happened a few other times, I follow him to see what he does. He goes a short distance and hides behind a building.

     

    I stand there, watch him crouch in the grass and think, "He has a lousy sneak skill."

     

    I walk around the building figuring I'll never see him again, when three other guys run up and ask if I've seen a thief.

    I say, "Of course! He's right over there!"

     

    Then I follow them and watch as they mete out justice.

    They never bother asking about the mace of frost I'm holding.

  15. From a RPing viewpoint Verullus is an average follower. aka quest follower.

     

    I mean, I talked to the guy, gave him sold gold, he follows me and kills stuff.

    That's pretty much like any other mercenary/henchman you can hire in the game.

     

    Granted, you can't change his inventory or tell him to wait around anywhere.

    In other words, I kept Verullus and left the quest hanging.

  16. I was walking on the road and came across a nobleman riding a horse.

    He wore a lovely suit of clothes and was leading his retinue, one man-at-arms in glass armor and two servants.

    I tried to talk to him but he insulted me and carried on his way.

     

    Well, I didn't want to straight out murder him...

     

    I told Mjoll to stay there and simply followed after the lout.

    About 2 minutes later the inevitable happened.

     

    A Sabrecat jumped out and attacked the travelers.

    The servants fell before the man-at-arms knew what was happening.

    Then to make things worse, a black wolf joined the fray.

     

    And the brave and noble Dovahkiin stood back, picking his teeth, watching nature run its course.

     

    When only beasts remained, I drew my sword.

    I stand here today to sing to you, I slew the Sabrecat, but I did not kill the nobleman,

  17. Actually, in FO3 and NV they didn't have any player nameable objects.

    The only text entry field they had was the player name.

     

    But yes, I was also thinking of a way to rename things.

     

    1) In FO3 Arcoolka renamed the Village Fast Travel marker. (Johnny's Village)

    2) In Skyrim, your pet/thrall has your name. (Johnny's Vampire)

    3) In Skyrim, NPC pets also have a possesive name. (Vampire's Draugr)

     

    So, i'm crossing my fingers and hoping I can figure out a way.

×
×
  • Create New...