Author Topic: Text appears when creature is dead?  (Read 408 times)

Legacy_Drethnor

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
Text appears when creature is dead?
« on: July 08, 2011, 12:28:50 am »


               I need the script for conversation text to appear only after you kill the creature. Anyone know how?':huh:'
 
               
               

               


                     Modifié par Drethnor, 07 juillet 2011 - 11:36 .
                     
                  


            

Legacy_Tiggers.no.tail

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Text appears when creature is dead?
« Reply #1 on: July 08, 2011, 07:01:35 pm »


               Can you clarify your meaning? Do you mean the NPC dies and yells something like "OMG no wai!?" Or do you mean that once a creature dies, it updates a variable in someone elses conversation file (i.e. the questgiver "hey i killed this guy")?
               
               

               


                     Modifié par Tiggers.no.tail, 08 juillet 2011 - 06:01 .
                     
                  


            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Text appears when creature is dead?
« Reply #2 on: July 08, 2011, 07:10:11 pm »


               In conversations, for each line you have "TextAppearsWhen..." tab at the action thingy on the right. If the script you enter to this tab returns TRUE, the NPC will say it/player can select the option.

If NPC has multiple lines after the same PC line, it will use topmost line that returns TRUE in starting conditional.

If you wish to start a conversation after you kill something, you need to cancel all actions to remove combat mode (in which you cant talk) and start the conversation with the PC itself. (cant converse with the dead o.o)
               
               

               


                     Modifié par Xardex, 08 juillet 2011 - 06:11 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Text appears when creature is dead?
« Reply #3 on: July 08, 2011, 08:17:28 pm »


               Something like this:


void main()
{
    object oKiller = GetLastKiller();
    if (GetIsObjectValid(GetMaster(oKiller)))
    oKiller = GetMaster(oKiller);

    AssignCommand(oKiller, ClearAllActions(TRUE));
    AssignCommand(oKiller, ActionStartConversation(oKiller, "conversation res ref"));
}
               
               

               
            

Legacy_Drethnor

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
Text appears when creature is dead?
« Reply #4 on: July 09, 2011, 03:41:40 pm »


               Ok, let me be more specific. I go into a room and kill a goblin. After I kill the goblin, and it's dead laying on the ground it becomes clickable and after I click it a conversation dialog pops up.
               
               

               
            

Legacy_Rowwena

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Text appears when creature is dead?
« Reply #5 on: July 09, 2011, 09:14:50 pm »


               Unless I am mistaken, what you will need is to create a "goblin corpse" placeable and a conversation to go with it, and then have a script that on your goblin's death will spawn in the corpse placeable instead of leaving a lootable corpse.

I am not positive, but there might be a function for this in one of the many OnDeath resources in the game. Just be careful when looking them and make sure you do not alter and save them, You can copy them to wordpad and then make your own script replacement to try.
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Text appears when creature is dead?
« Reply #6 on: July 09, 2011, 11:18:03 pm »


               Wordpad? How about just saving the script under a different name? '<img'>

Anyhow, assuming you have no custom content that allows you to create a placeable goblin corpse, and that you want the player to choose when to start the conversation, you could make the goblins OnDeath script create a trigger around it (and make the corpse unvanishing.) Entering the trigger would cause the conversation to begin.
               
               

               
            

Legacy_Drethnor

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
Text appears when creature is dead?
« Reply #7 on: July 10, 2011, 03:08:20 am »


               Just so I know there isn't some super simple way I over looked, I'm gonna try some of these ideas! Thanks guys!
               
               

               
            

Legacy_Rowwena

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Text appears when creature is dead?
« Reply #8 on: July 10, 2011, 09:15:15 am »


               Yes wordpad '<img'> or any other text file application. I tend to like to look at scripts I don't want to mess up in something other than the script editor, and it also allows me save my collection of scripts outside of the toolset - so it is easy to put them back into any mod I want.