[REQ/WIP] ModFood: Snippets & Tips

Post » Wed Dec 07, 2011 5:41 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
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Post » Wed Dec 07, 2011 12:44 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
Cheville Thompson
 
Posts: 3404
Joined: Sun Mar 25, 2007 2:33 pm

Post » Wed Dec 07, 2011 9:26 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
Tamara Primo
 
Posts: 3483
Joined: Fri Jul 28, 2006 7:15 am

Post » Wed Dec 07, 2011 2:38 pm

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
Jade Payton
 
Posts: 3417
Joined: Mon Sep 11, 2006 1:01 pm

Post » Wed Dec 07, 2011 3:31 pm

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
yermom
 
Posts: 3323
Joined: Mon Oct 15, 2007 12:56 pm

Post » Wed Dec 07, 2011 3:40 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
Vincent Joe
 
Posts: 3370
Joined: Wed Sep 26, 2007 1:13 pm

Post » Wed Dec 07, 2011 8:57 am

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
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm

Post » Wed Dec 07, 2011 5:26 am

VERY helpful topic - Thanks for making it. :goodjob:
User avatar
Mari martnez Martinez
 
Posts: 3500
Joined: Sat Aug 11, 2007 9:39 am

Post » Wed Dec 07, 2011 8:45 am

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
Sista Sila
 
Posts: 3381
Joined: Fri Mar 30, 2007 12:25 pm

Post » Wed Dec 07, 2011 7:14 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
Lisa Robb
 
Posts: 3542
Joined: Mon Nov 27, 2006 9:13 pm

Post » Wed Dec 07, 2011 4:21 pm

Switch gamemode to menumode :P

Good Job Felic!!! :)
User avatar
james kite
 
Posts: 3460
Joined: Sun Jul 22, 2007 8:52 am

Post » Wed Dec 07, 2011 8:59 am

Just a little bump to simulate a sticky!
User avatar
Andrew
 
Posts: 3521
Joined: Tue May 08, 2007 1:44 am

Post » Wed Dec 07, 2011 11:29 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
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Wed Dec 07, 2011 3:31 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
Yama Pi
 
Posts: 3384
Joined: Wed Apr 18, 2007 3:51 am

Post » Wed Dec 07, 2011 1:26 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
Stay-C
 
Posts: 3514
Joined: Sun Jul 16, 2006 2:04 am

Post » Wed Dec 07, 2011 10:56 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
Marilú
 
Posts: 3449
Joined: Sat Oct 07, 2006 7:17 am

Post » Wed Dec 07, 2011 4:59 am

About the Bound Arrow spell: you don't need to use the Form ID within scripts, use the Editor ID instead.
User avatar
Haley Merkley
 
Posts: 3356
Joined: Sat Jan 13, 2007 12:53 pm

Post » Wed Dec 07, 2011 4:26 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
Adam Porter
 
Posts: 3532
Joined: Sat Jun 02, 2007 10:47 am

Post » Wed Dec 07, 2011 1:52 pm

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


That's not bad after 1 week of scripting experience.
User avatar
Rachie Stout
 
Posts: 3480
Joined: Sun Jun 25, 2006 2:19 pm

Post » Wed Dec 07, 2011 3:22 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
Quick draw II
 
Posts: 3301
Joined: Thu Nov 08, 2007 4:11 pm

Post » Wed Dec 07, 2011 3:57 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
mishionary
 
Posts: 3414
Joined: Tue Feb 20, 2007 6:19 am

Post » Wed Dec 07, 2011 9:36 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
Joie Perez
 
Posts: 3410
Joined: Fri Sep 15, 2006 3:25 pm

Post » Wed Dec 07, 2011 4:30 am

Felic can i link this thread in my Modders Resource???
User avatar
NeverStopThe
 
Posts: 3405
Joined: Tue Mar 27, 2007 11:25 pm

Post » Wed Dec 07, 2011 2:25 pm

Yes, I said that in my last post in your ModRes thread.
User avatar
Laura
 
Posts: 3456
Joined: Sun Sep 10, 2006 7:11 am

Post » Wed Dec 07, 2011 4:29 pm

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
Vickey Martinez
 
Posts: 3455
Joined: Thu Apr 19, 2007 5:58 am

PreviousNext

Return to IV - Oblivion