Scripting help.

Post » Tue Nov 20, 2012 4:55 am

Scripting is not my strength. I was wondering if someone can write a script that after I finish talking to an npc, they initiate combat.

Edit: I would like to fight said npc in a duel with swords. I only want to defeat him not kill him. Then I want him to initiate dialogue with me.


Also I was wondering is it possible to make said npc after initiating dialogue be absorbed by the player. Sort of like when you absorb a dragon soul, but instead the npc.


Also how do I make npc's attack on site?
User avatar
Adam Kriner
 
Posts: 3448
Joined: Mon Aug 06, 2007 2:30 am

Post » Tue Nov 20, 2012 9:59 am

Scripting is not my strength. I was wondering if someone can write a script that after I finish talking to an npc, they initiate combat.

Edit: I would like to fight said npc in a duel with swords. I only want to defeat him not kill him. Then I want him to initiate dialogue with me.
for that take a look at the "Brawl" AI package and associated factions, not sure if its possible to do with swords.

Also I was wondering is it possible to make said npc after initiating dialogue be absorbed by the player. Sort of like when you absorb a dragon soul, but instead the npc.
possible yes, of the top of my head, look into the animations of the gray-beard, when they learn the player their shouts, sort of the same animation but should be possible to tweak it

Also how do I make npc's attack on site?
under factions add the "player enermy faction"
User avatar
Jessica Phoenix
 
Posts: 3420
Joined: Sat Jun 24, 2006 8:49 am

Post » Tue Nov 20, 2012 2:18 am

Thanks for your replies.

for that take a look at the "Brawl" AI package and associated factions, not sure if its possible to do with swords.

Does anyone know if it's possible to duel with swords?

possible yes, of the top of my head, look into the animations of the gray-beard, when they learn the player their shouts, sort of the same animation but should be possible to tweak it

Where are the animations located? and How do I make the npc play them?

Also what's the script to make an npc attack after dialogue?
User avatar
W E I R D
 
Posts: 3496
Joined: Tue Mar 20, 2007 10:08 am

Post » Tue Nov 20, 2012 7:15 am

Does anyone know if it's possible to duel with swords?

I don't know if it's possible, I haven't seen it done before but it may be possible.

Where are the animations located? and How do I make the npc play them?

You could use PlayIdle, you can find out more about it here: http://www.creationkit.com/PlayIdle_-_Actor

Also what's the script to make an npc attack after dialogue?

You can use StartCombat which allows you to make an Npc start combat with another Npc or the player. You can find out more about it here: http://www.creationkit.com/StartCombat_-_Actor
User avatar
BRAD MONTGOMERY
 
Posts: 3354
Joined: Mon Nov 19, 2007 10:43 pm

Post » Tue Nov 20, 2012 7:48 am

If I recall correctly, the first time one enters Jorrvaskr, two companions will be duelling with weapons. It might be worthwhile taking a look around.
User avatar
Petr Jordy Zugar
 
Posts: 3497
Joined: Tue Jul 03, 2007 10:10 pm

Post » Tue Nov 20, 2012 3:41 am

You can use StartCombat which allows you to make an Npc start combat with another Npc or the player. You can find out more about it here: http://www.creationkit.com/StartCombat_-_Actor

But how do I let the game know to initiate combat after speaking to the npc? Can someone give an example?
User avatar
butterfly
 
Posts: 3467
Joined: Wed Aug 16, 2006 8:20 pm

Post » Tue Nov 20, 2012 9:43 am

But how do I let the game know to initiate combat after speaking to the npc? Can someone give an example?

Edit: Oh sorry, but... Can't you make the dialogue set a quest stage, and then add the script function into the script fragment for that stage? That's my guess at least, but I have not done anything with dialogue yet so it may be off.
User avatar
Amysaurusrex
 
Posts: 3432
Joined: Wed Aug 09, 2006 2:45 pm

Post » Tue Nov 20, 2012 2:57 am

If you're using bits of the courier script to force conversation with the player, it should be pretty simple to run StartCombat near the bottom (or where appropriate) as seventyfour suggested. To prevent them from dying you can make that character essential. When their health reaches zero they will enter the bleedout state, once in this state you can have code like StopCombat and possibly more conversation or just cut straight to the greybeard dragon soul thing.......
Hope this helps.
User avatar
Steeeph
 
Posts: 3443
Joined: Wed Apr 04, 2007 8:28 am

Post » Mon Nov 19, 2012 10:13 pm

Thanks for the replies. I did a search and found this script found in http://www.gamesas.com/topic/1386310-dialogue-question/page__p__21038222__hl__startcombat__fromsearch__1#entry21038222 thread. It works, although I wanted everyone to attack at once after initiating dialogue. Now I have to figure out how to do the soul absorption.

Ok, I believe I found the script that is used when the Greybeards are training you. You know when they teach a word and you absorb the knowledge.


;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 12Scriptname QF_MQHighHrothgarTraining1_0010C045 Extends Quest Hidden;BEGIN ALIAS PROPERTY Greybeard;ALIAS PROPERTY TYPE ReferenceAliasReferenceAlias Property Alias_Greybeard Auto;END ALIAS PROPERTY;BEGIN FRAGMENT Fragment_5Function Fragment_5();BEGIN CODE; debug.trace(self + " DONE")Stop();END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_3Function Fragment_3();BEGIN CODE; debug.trace(self + " STARTED");END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Does any of this look like the script, for the player to absorb knowledge?
User avatar
Robyn Howlett
 
Posts: 3332
Joined: Wed Aug 23, 2006 9:01 pm


Return to V - Skyrim