CreatureNPC Summoning Script

Post » Thu Dec 24, 2009 3:01 pm

I'd like to know the basics of a script that would summon a creature or NPC if the player picked up an object, opened a door, moved a lever, etc. I don't know if it's the same for every action, but if I someone could give me the basic layout and I could change the ID to match whatever was I want summoned, that would be very useful. I saw there's some scrolls in the CS that begin with BILL. I originally had a Dremora summoned, but that just doesn't fit in my mod, so i'd like to maybe even create a new creature or NPC to be summoned. This would be good to know for future reference as well. If this is the case and it is applicable, how would I have the summoned creature/NPC use dialogue? Would it be the same as if they were just standing there and the player approached?
User avatar
Eduardo Rosas
 
Posts: 3381
Joined: Thu Oct 18, 2007 3:15 pm

Post » Thu Dec 24, 2009 8:55 am

The script itself isn't too difficult, and can be keyed to onactivate, onpcdrop, onpcequip, and so forth. the cursed items that summon the dremora and dwemer ghosts and so forth use the basic script.

As to dialogue, when you make the creature, set the ai fight to 30, flee to 10, alarm to 30, hello to 30. Then if you want it to attack, startcombat in the dialogue results box.

Begin BILL_MarksDwvGhostSummon; Summon an Dwarven Ghost when a cursed Dwarven coin is pulled from a skull;; script location: should be placed on a Dwarven Coin stuck in a skull;fixed 03/20. Could still be wierdness.; variablesshort doneif ( OnActivate == 1 )	if ( done == 1 )		Activate		return	else		PlaceAtPC "dwarven ghost", 1, 128, 1		; 1 of them, 256 units away, in back (1) of the player		set done to 1		Activate	endifendifEnd


This is probably the code you had or very similar. All you have to do is change the object ID from dwarven ghost to the object ID of whatever creature you want summoned. Just remember that if you want dialgue, it has to be a creature whose AI fight isn't still 90.
User avatar
latrina
 
Posts: 3440
Joined: Mon Aug 20, 2007 4:31 pm

Post » Thu Dec 24, 2009 9:17 am

Ahh. I just took another look at that script and it does look very simple. So I assume where it says 'Dremora lord" for instance, I could basically replace it with any NPC, item, static, etc.?
User avatar
Noraima Vega
 
Posts: 3467
Joined: Wed Jun 06, 2007 7:28 am

Post » Thu Dec 24, 2009 11:27 am

Ahh. I just took another look at that script and it does look very simple. So I assume where it says 'Dremora lord" for instance, I could basically replace it with any NPC, item, static, etc.?


Thats right. :)
User avatar
Robert DeLarosa
 
Posts: 3415
Joined: Tue Sep 04, 2007 3:43 pm

Post » Thu Dec 24, 2009 7:02 pm

Wow. That is easy. Hopefully I won't overuse it. Thanks.
User avatar
R.I.P
 
Posts: 3370
Joined: Sat Dec 01, 2007 8:11 pm

Post » Thu Dec 24, 2009 10:43 am

Say I wanted to add a ForceGreeting command to that script, so when the creature or NPC appears, they force dialogue, then attack. How would I do that?
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm

Post » Thu Dec 24, 2009 11:27 pm

Well the SetFight command http://www.uesp.net/wiki/Tes3Mod:SetStat will start the fight I believe. But I'm still new to command usage.


Added a bit latter : Oh ForceGreeting usage here... http://www.uesp.net/wiki/Tes3Mod:ForceGreeting Wooo.
User avatar
Sammi Jones
 
Posts: 3407
Joined: Thu Nov 23, 2006 7:59 am

Post » Thu Dec 24, 2009 7:14 pm

Yeah, it will. Also changing the AI fight to 100 I believe. I know how to do a ForceGreeting by itself, just not sure how to add it to a pre-existing script.
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Thu Dec 24, 2009 6:21 pm

2 examples are listed I think it can be found in the editor.

anoScript
dinScript
User avatar
Bellismydesi
 
Posts: 3360
Joined: Sun Jun 18, 2006 7:25 am

Post » Thu Dec 24, 2009 4:09 pm

I'm also trying to figure out how to summon an NPC when the player tries to open a door. The door will be blocked, and i'd like a message telling the player this. I don't know much about scripting, but i've tried to mix the summon script and the blocked door script, and i'm sure something is wrong here. I just don't know exactly what.

begin Script

short done

if ( MenuMode == 1 )
return
endif

if ( OnActivate == 1 )
if ( done == 1 )
Activate
return
else
PlaceAtPC "badguy", 1, 128, 1
set done to 1
Activate
endif

endif

end Script

The "badguy" is summoned, but the door still opens.

@ Sir Henry Echo: Yeah, it's in the CS script list. Only thing is i'm not exactly sure where in the script to put "ForceGreeting". Those ones have a lot of extra stuff in it that I don't understand.

Edit: Now that I think about it, I really don't need to add the ForceGreeting script to the summon script. The summon script would be attached to an object (or whatever), and the ForceGreeting script should actually be added to the NPC/creature. I already have the ForceGreeting script in another mod i'm working on, but that one has a GetDistance command in it.
User avatar
Sammykins
 
Posts: 3330
Joined: Fri Jun 23, 2006 10:48 am

Post » Thu Dec 24, 2009 4:16 pm

I think this would work, need to figure out how to display the tabs better. I think all you have to do is put those shorts at the top of the summons script and add the following below the summoning script. Assuming the distance is correct.

short doonce
short greetonce

If ( GetDistance Player <= 256 )
if ( greetonce == 0 )
ForceGreeting
set greetonce to -1
"Your_SummonedCreature"->ForceGreeting
set doonce to -1
endif
endif

Added a bit latter: Ah the joys of experimenting...
Added a bit more later: oh give the key to the npc for that door, and set the door's lock level to 0 I remember one of the 6th house bases being like that, you needed that key to open the door no matter what or leave the key out maybe.
User avatar
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Thu Dec 24, 2009 2:00 pm

Yes, I know. Morrowind has brought me a lot of entertainment as well as an equal (if not much more) amount of frustration. Here's that other script I was talking about:

begin Script

short doonce

if ( Menumode == 1 )
return

endif

if ( doonce == 1 )
return
endif

if ( GetDistance Player <=256 )
ForceGreeting
set doonce to 1

endif

end Script

This has been given to me by a reliable source and has been tested. Works exactly like it should. I suppose I could just attach this script to the NPC/creature. My only issue now is to get that door to display a message saying it's blocked and also to summon the NPC. I checked out the BILL_MarksDaedraSummon script (which summons a Daedra Lord once the player picks up a cursed coin), but since the player can pick up the coin, drop it again, and pick it up as many more times as he/she wants, that doesn't really apply in my situation.

Edit: As far as the tabs go, I think I get the general idea now.
User avatar
Josh Dagreat
 
Posts: 3438
Joined: Fri Oct 19, 2007 3:07 am

Post » Thu Dec 24, 2009 1:00 pm

The door is just a false door that doesn't open or lead anywhere. I thought about the lock level being set to 0, but I still don't know how to allow it to display a blocked message or summon the NPC.
User avatar
Tracy Byworth
 
Posts: 3403
Joined: Sun Jul 02, 2006 10:09 pm

Post » Fri Dec 25, 2009 1:15 am

This was my idea of a script that combined the activate summoning add greeting... if I'm wrong someone say so...

short doonce
short greetonce

If ( GetDistance Player <= 256 )
if ( greetonce == 0 )
ForceGreeting
set greetonce to -1
"Your_SummonedCreature"->ForceGreeting
"Your_SummonedCreature"->SetFight, 100
set doonce to -1
endif
endif

Also added "Your_SummonedCreature"->SetFight, 100

So it might end up looking like...

begin Script

short done
short doonce
short greetonce

if ( MenuMode == 1 )
return
endif

if ( onactivate == 1 )
if ( done == 1 )
Activate
return
else
PlaceAtPC "badguy", 1, 128, 1
set done to 1
Activate
endif

endif

If ( GetDistance Player <= 256 )
if ( greetonce == 0 )
ForceGreeting
set greetonce to -1
"Your_SummonedCreature"->ForceGreeting
"Your_SummonedCreature"->SetFight, 100
set doonce to -1
endif
endif

end Script

Someone correct me if I'm wrong?
User avatar
djimi
 
Posts: 3519
Joined: Mon Oct 23, 2006 6:44 am

Post » Thu Dec 24, 2009 9:04 pm

The door is just a false door that doesn't open or lead anywhere. I thought about the lock level being set to 0, but I still don't know how to allow it to display a blocked message or summon the NPC.


Wouldn't the summon script work on the door? So activating the door summons the npc?

Added a bit latter again: http://www.uesp.net/wiki/Tes3Mod:MessageBox

Ahh I just had the idea... have the simple message box script on the on the door outlined above in usage... and towards the end of the message box script have a StartScript "summon/fight_script" command acctivating the summoning / greeting and fight script...
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am

Post » Thu Dec 24, 2009 12:25 pm

Yes, that's what i'm trying to do. I attached the ForceGreeting script to the NPC, so I assume once it's summoned and being within 256 units from the player, the greeting will appear. I just need to know how to combine summoning the creature and having a message displayed when the player attempts to open the door on one script and place this script on the door itself. I know how to display a message using the 'MessageBox' command. My problem is I just don't know exactly how to put all of these things in one script, and in what order they need to go to work properly and also keep it so that the NPC is only summoned the first time the player attempts to open that door.

Edit: I decided to just have the MW blockeddoor script on the door and used an activator to summon the NPC. Tested and works fine. I'd still like to know how to use a blocked or barred door (or something similar that can be opened several times) to summon a creature/NPC.
User avatar
ZzZz
 
Posts: 3396
Joined: Sat Jul 08, 2006 9:56 pm


Return to III - Morrowind