[REQ/WIP] ModFood: Snippets & Tips

Post » Sat Feb 19, 2011 5:48 am

Such a helpful thread can't be lost so I'm posting this. Anyways, is this thread used for just helping people, or only helping with scripting, maybe if it gets stickied or something it can be an all-round guide. I'm an O.k scriptor, can't even import or export into blender, but I am good at retexturing and i'm good at overall help.
User avatar
Rachael
 
Posts: 3412
Joined: Sat Feb 17, 2007 2:10 pm

Post » Fri Feb 18, 2011 10:06 pm

Request: Quest Making

I think that it would be nice if somebody put a written guide here on how to create a quest, that would be nice. Also, could somebody put quest functions like (it would be a miracle if these acctually existed.)

SkipQuestStage x - Replace The 'x' with a number and after that script, it will skip however many quest stages you put as the number. For example:
Begin OnActivate   Player.MoveTo 'ref ID'   SkipQuestStage 2   Messagebox "You Have Been Teleported To An Unknown Hall."End


Obviously, before you try it, i am almost certain that SkipQuestStage is not a real command because it was off the top of my head, but I might be psychic ;)
User avatar
Kelly Osbourne Kelly
 
Posts: 3426
Joined: Sun Nov 05, 2006 6:56 pm

Post » Sat Feb 19, 2011 5:13 am

Anyways, is this thread used for just helping people, or only helping with scripting, maybe if it gets stickied or something it can be an all-round guide.

The intention of this thread was initially solely to gather snippets of code with explanations on how to implement them. Some people are suggesting expanding it to other mod resources, which I consider a longer-term goal while we discuss it.

Request: Quest Making
I think that it would be nice if somebody put a written guide here on how to create a quest, that would be nice.

Well, this is where the CS Wiki has its strengths. It does have a pretty complete guide on basic http://cs.elderscrolls.com/constwiki/index.php/Category:Quests. Where I see this thread (& its expansion) can be more useful is in providing more advanced snippets of code to accomplish specific things within a certain type of quest.

Also, could somebody put quest functions like (it would be a miracle if these acctually existed.)
SkipQuestStage x [snip] Obviously, before you try it, i am almost certain that SkipQuestStage is not a real command because it was off the top of my head, but I might be psychic

This is for the http://www.elderscrolls.com/forums/index.php?showforum=22, and defeats the purpose of creating Quests in the first place.

But, here's what you're looking for: :wink:
GetStage QuestFormID (this will show you the current stage in the quest)
SetStage QuestFormID Stage# (this will advance you to a certain stage in the quest)
CAQS (this will complete all stages of the active quest)
MoveToQT (this will move the player to the active quest target)
User avatar
X(S.a.R.a.H)X
 
Posts: 3413
Joined: Tue Feb 20, 2007 2:38 pm

Post » Sat Feb 19, 2011 5:47 am

This is all I have to say:

Thanks Felic,
O.k, The CS wiki is good for that,
3: Taken care of, thanks
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am

Post » Sat Feb 19, 2011 3:27 am

I'M NOT A GIRL!

Oops, so soz 'bout that! See my fix:

http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9193226
User avatar
LijLuva
 
Posts: 3347
Joined: Wed Sep 20, 2006 1:59 am

Post » Sat Feb 19, 2011 10:12 am

Objective: Creating an Options Button Inside of a Container

This is a pet peeve of mine. There are some containers that you usually want to open, and occasionally want to fool around with the options. So...

Options

A. Use an arrow - this ensures the options are the top-most item/button in the container menu.
Shortfall - will have a very brief remove item spam, which can be http://www.elderscrolls.com/forums/index.php?showtopic=632323&st=3.
B. Use a weapon - this can have a script placed on it so no remove item message
Shortfall - may not always be the top-most item

Steps

1. Create or extract an icon image for your options
2. Edit an item - in the ID slot call it OptMenu, " Options" (note the space!) for the name, set the icon image
3. Place at least 2 of the item in the container
4.A. Add this script to the container

begin MenuMode 1008  if (player.GetItemCount OptMenu == 0)	return  else	player.RemoveItem OptMenu 1	AddItem OptMenu 1	messagebox "Your options"	...


4.B. Add this script to the weapon

begin onAdd player  YourContainer.Activate YourWeapon, 1  YourContainer.AddItem YourWeapon 1  RemoveMeend


and this to the container

begin onActivate  if (IsActionRef YourWeapon == 1)  messagebox "Your options"  ...

User avatar
Klaire
 
Posts: 3405
Joined: Wed Sep 27, 2006 7:56 am

Post » Fri Feb 18, 2011 8:21 pm

Objective: Make a ring that adds a spell when it's worn by the player

This script adds another spell if a NPC wear it. And display a message only when the player wear it.
You need a ring or any other clothing and some spells.

Ring Script:
scn J3Xringscriptref userrefbegin onequip   set UserRef to GetContainer   if userref != player	  userref.addspell J3Xringspell   else	  userref.addspell J3Xringspell2	  message "You have gained a ability"   endendbegin onunequip   set UserRef to GetContainer   if userref != player	  userref.removespell J3Xringspell   else	  userref.removespell J3Xringspell2	  message "You have no longer a ability"   endend

User avatar
Taylah Haines
 
Posts: 3439
Joined: Tue Feb 13, 2007 3:10 am

Post » Sat Feb 19, 2011 7:13 am

VERY helpful topic - Thanks for making it. :goodjob:
User avatar
Umpyre Records
 
Posts: 3436
Joined: Tue Nov 13, 2007 4:19 pm

Post » Fri Feb 18, 2011 8:25 pm

Thanks Feek.

OK peeps, this is my first attempt at adding some style & organization to the index, let me know if you hate it. :wink:
User avatar
Kim Bradley
 
Posts: 3427
Joined: Sat Aug 18, 2007 6:00 am

Post » Sat Feb 19, 2011 9:17 am

Objective: Menu Template (MessageBox) for lazy people like me

Scriptname aaaMenushort Choiceshort ChosenBegin OnActivate	if IsActionRef Player		MessageBox "Template", "Button00", "Button01", "Button02", "Button03", "Button04", "Button05", "Button06", "Button07", "Button08", "Cancel"		set Chosen to 1	endifEndBegin GameMode; or use MenuMode	if Chosen			set Choice to getButtonPressed		if Choice > -1			set Chosen to 0			if Choice == 0				ResultingCode			elseif Choice == 1				ResultingCode			elseif Choice == 2				ResultingCode			elseif Choice == 3				ResultingCode			elseif Choice == 4				ResultingCode			elseif Choice == 5				ResultingCode			elseif Choice == 6				ResultingCode			elseif Choice == 7				ResultingCode			elseif Choice == 8				ResultingCode			elseif Choice == 9				Return			endif		endif	endifEnd

User avatar
Greg Swan
 
Posts: 3413
Joined: Tue Jun 05, 2007 12:49 am

Post » Fri Feb 18, 2011 11:28 pm

Switch gamemode to menumode :P

Good Job Felic!!! :)
User avatar
Alyesha Neufeld
 
Posts: 3421
Joined: Fri Jan 19, 2007 10:45 am

Post » Sat Feb 19, 2011 12:17 pm

Just a little bump to simulate a sticky!
User avatar
Jessie
 
Posts: 3343
Joined: Sat Oct 14, 2006 2:54 am

Post » Sat Feb 19, 2011 1:21 am

Bound Arrows Tutorial
From The Elder Scrolls Construction Set Wiki - Written by Logam

Hi,

We all know that bound arrows are not included in the original oblivion esm. And being an archer with hundreds of arrows can add a bit of weight to your maximum weight limit. This tutorial requires:

Basic Scripting Knowledge Fair Knowledge of the TES Construction Set 


I am going to teach you how to create a mod which will add the spell bound arrows to your character so that you do not need to carry lots of arrows around.

Let Us Start::

1. Open up the Construction Set and load up the Oblivion esm.

Creating the items for the scripts:

Firstly, go to the objects window and select ITEMS then AMMO the click DAEDRIC. Next, right click on
arrow8daedric
and click edit.

This should bring up the arrows properties...

Next, we edit the properties so change the following things to the same as i have.

ID - aaaBoundArrow (aaa so that it is at top of list) Name - Bound Arrow Enchantment - NONE Make sure that IgnoresNormalWeaponResistance is ticked Weight - 0 Value - 0 Speed - Leave as it is Damage - 20 


Click OK and if it asks to create new form ID then click OK!!!

Hold mouse over arrow to get a code that has a combination of numbers and letters. Write it down.

Go to the MAGIC tab in the object window, then SPELL and then SPELL again...

Create a new spell by right clicking on an spell and click NEW.

Make sure the spell properties are as the following.

ID - aaaBoundArrowsSpellName - Bound Arrows Make sure every box is ticked except Area Effect Ignore LOS Make sure auto calculate is unchecked and put spell level NOVICE and spell cost 30. Click OK and then say OK to the create new form ID box... 


Hold mouse over spell to get a code that has a combination of numbers and letters right that down.

NOW FOR THE SCRIPTS -

Go to gameplay - edit scripts - then click on script and new.

Type the following in to the box.

scn aaaBoundArrowSpellScript Begin ScriptEffectStart 	PlayMagicVisualShaders SummonMythicDawn 5	player.additem 'arrows code' 50	player.equipitem 'arrows code' 50End Begin ScriptEffectFinish 	player.unequipitem 'arrowscode'	player.removeitem 'arrows code' 50End 


EQUIPPING THE SCRIPT TO THE SPELL -

Now go back to the spell we made and right click then edit it again... On the right it should have a box that says 'effects'.

Right click in the box and click new.

Change the Effect to Script Effect.'Keep range as self and make duration 30 seconds, this will make it so the spell will cast on the player and last for 30 seconds before removing the bound arrows.

Change script to aaaBoundArrowSpellScript Change Script Name to Bound Arrow Change school to Conjuration Visual Effect to bound bow
Then un-check the effect is hostile box.

Click OK and then save the mod as BoundArrowSpellMod. Load up the game without any mods except our arrow mod. When in the game open the console by pressing ~ and type:

player.addspell 'spell code' and then press enter.


You have just created your own spell mod that adds magic arrows through a spell, good work and happy modding.

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

this spell code looks like this: yyxxxxxx. yy is used to reference the plugin, xxxxxx to reference the item inside the plugin (and does not change), in this case its the xxxxxx of the editorid of the spell. yy changed depending on your mod load order, if its the first loaded its 01, second 02... (remember that this coding is in Hex!)


--------------------------------------------------------------------------------
User avatar
Richard Thompson
 
Posts: 3302
Joined: Mon Jun 04, 2007 3:49 am

Post » Sat Feb 19, 2011 12:01 pm

Objective: Soulgem soulevel detection Script

A script that detects the soul level from a soulgem, request OBSE 0.9a

The soullevels:
0:	None1:	Petty2:	Lesser3:	Common4:	Greater5:	Grand - Humanoid


Example Script:
ref yoursoulshort soullevelset soullevel to GetSoulLevel yoursoulif soullevel == 5   message "You have stealed a humans soul!"   modpcinfamy 2  ; Do thingelseif soullevel > 0   message "It's just a normal soul"else   message "No soul in the soulgem"endif

User avatar
Emilie Joseph
 
Posts: 3387
Joined: Thu Mar 15, 2007 6:28 am

Post » Fri Feb 18, 2011 9:54 pm

Objective: Mark & Recall Teleportation Spells

Make two spells that allow you to mark a spot that you can return to via the recall spell from anywhere in the game.

Thanks to weasel93 for the script.

Place a teleport marker somewher in Tamriel and give it a Reference ID (let's use "aaaMarkRecallTeleport").
Create a "Mark" spell and attatch this script via Script Effect (and give it a cool visual effect):

Scn aaaMarkSpellScriptBegin ScriptEffectStart	aaaMarkRecallTeleport.MoveTo player	MessageBox "You have marked this location."End


Then make a "Recall" spell and attatch this script to it:

Scn aaaRecallSpellScriptBegin ScriptEffectStart	Player.MoveToMarker aaaMarkRecallTeleportEnd


Fini!
User avatar
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am

Post » Sat Feb 19, 2011 4:20 am

Hey Felic, I changed the title of my first post (Avoiding remove item....) to a more general title. Could you please update the head post to reflect it. Thanks.

p.s. I did so after finally finding some conformation deep in the http://cs.elderscrolls.com/constwiki/index.php/Preventing_messages of the wiki.
User avatar
Tamara Primo
 
Posts: 3483
Joined: Fri Jul 28, 2006 7:15 am

Post » Sat Feb 19, 2011 1:37 am

About the Bound Arrow spell: you don't need to use the Form ID within scripts, use the Editor ID instead.
User avatar
Leah
 
Posts: 3358
Joined: Wed Nov 01, 2006 3:11 pm

Post » Sat Feb 19, 2011 1:43 am

About the Bound Arrow spell: you don't need to use the Form ID within scripts, use the Editor ID instead.


I wrote that tutorial about 1 week after i started modding :P
User avatar
Pat RiMsey
 
Posts: 3306
Joined: Fri Oct 19, 2007 1:22 am

Post » Sat Feb 19, 2011 8:19 am

I wrote that tutorial about 1 week after i started modding :P


That's not bad after 1 week of scripting experience.
User avatar
Madeleine Rose Walsh
 
Posts: 3425
Joined: Wed Oct 04, 2006 2:07 am

Post » Sat Feb 19, 2011 12:01 am

I wrote that tutorial about 1 week after i started modding :P


Hmm... same here, odd. Did we scare away the vanguards? Please come back! I'm tired of noticing the mistakes in my code myself (they're minor! but still there).
User avatar
Kortknee Bell
 
Posts: 3345
Joined: Tue Jan 30, 2007 5:05 pm

Post » Fri Feb 18, 2011 9:10 pm

Hmm... same here, odd. Did we scare away the vanguards? Please come back! I'm tired of noticing the mistakes in my code myself (they're minor! but still there).


Haama, can you please explain what you are saying???

I can't figure out what you mean by your previous post :embarrased:
User avatar
Mrs Pooh
 
Posts: 3340
Joined: Wed Oct 24, 2007 7:30 pm

Post » Sat Feb 19, 2011 11:44 am

Haama, can you please explain what you are saying???

I can't figure out what you mean by your previous post :embarrased:


Oh, and I came here to post a snippet request. The best I remember I meant that it's kind-of odd that only 5 people have posted anything so far. More snippets or even comments on snippets would be much appreciated! Anyway, on to buisness:

I'd like to request a snippet that has an item find the nearest object along it's front/back axis, orients itself to the face of that object, and plants itself on that object. For me, I'm trying to allow players to construct their own desks by placing drawer face plates onto the surface (hopefully the side surface). Thanks in advance. If no one has anything like this, then expect to see it here in a few weeks.
User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Post » Fri Feb 18, 2011 9:22 pm

Felic can i link this thread in my Modders Resource???
User avatar
Eve Booker
 
Posts: 3300
Joined: Thu Jul 20, 2006 7:53 pm

Post » Fri Feb 18, 2011 11:22 pm

Yes, I said that in my last post in your ModRes thread.
User avatar
Danielle Brown
 
Posts: 3380
Joined: Wed Sep 27, 2006 6:03 am

Post » Sat Feb 19, 2011 4:43 am

Went on a very awkward vacation, don't ask why we did it in Febuary cuz I don't know, but I'm back now :)

B.T.W, why do you change your sig like, every other week logam.
User avatar
lucile davignon
 
Posts: 3375
Joined: Thu Mar 22, 2007 10:40 pm

PreviousNext

Return to IV - Oblivion