[REQWIP] ModFood: Snippets & Tips

Post » Mon May 07, 2012 5:37 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
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Mon May 07, 2012 2:23 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
Andrew Perry
 
Posts: 3505
Joined: Sat Jul 07, 2007 5:40 am

Post » Mon May 07, 2012 12:57 pm

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
Charlie Ramsden
 
Posts: 3434
Joined: Fri Jun 15, 2007 7:53 pm

Post » Mon May 07, 2012 6:57 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
Jani Eayon
 
Posts: 3435
Joined: Sun Mar 25, 2007 12:19 pm

Post » Mon May 07, 2012 7:19 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
Andrew Lang
 
Posts: 3489
Joined: Thu Oct 11, 2007 8:50 pm

Post » Mon May 07, 2012 11:53 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
Breautiful
 
Posts: 3539
Joined: Tue Jan 16, 2007 6:51 am

Post » Mon May 07, 2012 11:29 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
YO MAma
 
Posts: 3321
Joined: Thu Dec 21, 2006 8:24 am

Post » Mon May 07, 2012 5:53 am

VERY helpful topic - Thanks for making it. :goodjob:
User avatar
+++CAZZY
 
Posts: 3403
Joined: Wed Sep 13, 2006 1:04 pm

Post » Mon May 07, 2012 3:18 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
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm

Post » Mon May 07, 2012 2:38 pm

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
Damian Parsons
 
Posts: 3375
Joined: Wed Nov 07, 2007 6:48 am

Post » Mon May 07, 2012 6:55 am

Switch gamemode to menumode :P

Good Job Felic!!! :)
User avatar
Project
 
Posts: 3490
Joined: Fri May 04, 2007 7:58 am

Post » Mon May 07, 2012 7:03 pm

Just a little bump to simulate a sticky!
User avatar
Frank Firefly
 
Posts: 3429
Joined: Sun Aug 19, 2007 9:34 am

Post » Mon May 07, 2012 1:51 pm

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
Jessica Thomson
 
Posts: 3337
Joined: Fri Jul 21, 2006 5:10 am

Post » Mon May 07, 2012 6:28 am

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
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am

Post » Mon May 07, 2012 5:27 am

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
QuinDINGDONGcey
 
Posts: 3369
Joined: Mon Jul 23, 2007 4:11 pm

Post » Mon May 07, 2012 12:52 pm

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
xemmybx
 
Posts: 3372
Joined: Thu Jun 22, 2006 2:01 pm

Post » Mon May 07, 2012 7:42 pm

About the Bound Arrow spell: you don't need to use the Form ID within scripts, use the Editor ID instead.
User avatar
Alada Vaginah
 
Posts: 3368
Joined: Sun Jun 25, 2006 8:31 pm

Post » Mon May 07, 2012 7:10 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
Kelly James
 
Posts: 3266
Joined: Wed Oct 04, 2006 7:33 pm

Post » Mon May 07, 2012 2:39 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
CxvIII
 
Posts: 3329
Joined: Wed Sep 06, 2006 10:35 pm

Post » Mon May 07, 2012 1:00 pm

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
Mariana
 
Posts: 3426
Joined: Mon Jun 12, 2006 9:39 pm

Post » Mon May 07, 2012 6:35 am

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
Kanaoka
 
Posts: 3416
Joined: Fri Jun 16, 2006 2:24 pm

Post » Mon May 07, 2012 3:21 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
Roisan Sweeney
 
Posts: 3462
Joined: Sun Aug 13, 2006 8:28 pm

Post » Mon May 07, 2012 5:37 am

Felic can i link this thread in my Modders Resource???
User avatar
Nicole M
 
Posts: 3501
Joined: Thu Jun 15, 2006 6:31 am

Post » Mon May 07, 2012 11:54 am

Yes, I said that in my last post in your ModRes thread.
User avatar
lolli
 
Posts: 3485
Joined: Mon Jan 01, 2007 10:42 am

Post » Mon May 07, 2012 7:50 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
Ronald
 
Posts: 3319
Joined: Sun Aug 05, 2007 12:16 am

PreviousNext

Return to IV - Oblivion