[REQWIP] ModFood: Snippets & Tips

Post » Mon May 07, 2012 6:04 pm


===== Available Scripts/Tutorials =====

  • ICUP's http://index.php?showtopic=579010

=== Activators ===
  • http://www.elderscrolls.com/forums/index.php?showtopic=632323&st=75
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9184853
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9186764

=== Changing Game Defaults ===
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9176286
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9186764

=== Containers ===
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9193356
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9200962

=== Magic Items & Objects ===
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9423295
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9172816
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9202096
  • http://www.elderscrolls.com/forums/index.php?showtopic=632323&st=77
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9186764

=== Manipulating Inventory (Items/Spells) ===
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9172260
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9182218

=== Multipurpose/Miscellaneous Scripts ===
  • http://www.elderscrolls.com/forums/index.php?showtopic=632323&st=72
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9343591
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9302281
  • http://www.elderscrolls.com/forums/index.php?showtopic=632323&st=70
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9209903

=== Spells ===
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9190859
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9208815
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9224370

=== Templates ===
  • http://www.elderscrolls.com/forums/index.php?act=ST&f=24&t=632323&hl=&view=findpost&p=9204264


===== My $0.02 =====

=== Posted 2007-02-03 @ 07:26 AM ===
Yeah, I know there are scripting & modding resources out there, as well as the CS Wiki, etc. But, I thought this forum's community might put together a collection of useful code snippets with a basic explanation of what they do and how to implement them. An archive of script/code/tricks as modding resources, including descriptions of AI packages and Quest/Dialog/Conditions (and scripts to manipulate them) for specific purposes.

I believe this should be on a "no credit necessary, but it's always nice" basis. We could also eventually release it for distribution on modding sites.

For one thing, whenever someone posts a question that's already been answered here, we could point them to this thread.

Of course, no need to duplicate the basic tutorials already available. The goal here is to be more specific than a general description of what is possible, generating a compendium of effective, useful and adaptable code for general modding purposes.

This is not meant to be another "Modding 101: How to Create a Quest" thing, but rather a "Useful Code/AI Packages for Creating a Companion Mod" (for example) kind of thing. Something along the lines of http://www.elderscrolls.com/forums/index.php?showtopic=603259 But that would be just one entry, the goal is to get a bunch of different types of scripting/coding resources together.

It should go beyond comments like "just open the CS and see how this quest is done", or "open this mod and see how X modder did this", as it should attempt to walk the modder through the necessary steps. I'm not talking holding hands, just some more help than "figure it out dude" or "RTFM". Hey, I'm guilty of that sometimes, but at least I'm trying.

C'mon guys & gals, time to spill your Bag o' Tricks!

I volunteer to keep track of the contributions in an organized format available for download somewhere to be determined. In terms of format, I propose the following example as an initial contribution. I will strive to add more, as well as more advanced code.

=== Addendum 2007-02-04 @ 03:20 AM ===
Well, here's my second contrib, with thanks to TomWithTheWeather.

=== Addendum 2007-02-04 @ 09:25 PM ===
Thanks in advance to any other contributors:
I'd like to keep this thread bare of too much pvssyr.

=== Addendum 2007-02-06 @ 05:45 AM ===
Why ModFood? I'm a music FANATIC, and I was always impressed with the DJ Food concept:
rather than a real band, they put stuff together as "Food" for DJs. Hence this idea.

=== Addendum 2007-02-08 @ 04:38 AM ===
Why not just contribute to the CS Wiki? I just have a hard time finding what I need there. More often than not I have to revert to posting a question on this forum. The Wiki is a great resource for the basic Guides/Tutorials and as an all-encompassing encyclopedic list of everything in the CS, but is not intuitively organized for finding stuff like on this thread. As ModFood grows, it will have to be moved to a more organizable format, probably some website. But rather than try to be all encomapssing like the Wiki, I just want to compile a compact modder's resource with clear categories for commonly used code snippets. Where I see this thread (& its expansion) can be useful is in providing advanced snippets of code to accomplish specific things under certain conditions.



===== Credits/Thanks (I apologize if I forgot someone) =====

=== Thanks for your contributions & support! ===
Comandra
haama
J3X
Logam
TheMadMage
ThisIsUsMc
WillieSea

=== Thanks for the support & positive feedback! ===
Feek165
gibbo912
Kalibr
Qazaaq
User avatar
Syaza Ramali
 
Posts: 3466
Joined: Wed Jan 24, 2007 10:46 am

Post » Mon May 07, 2012 7:42 am

Objective: Automatically adding items or spells upon loading a mod for the first time

Options

A. Creating a new mod to add standard game objects:
Open the CS with just Oblivion.esm selected in the Data Files.
Follow the steps below and save as a new esp file in the Data folder.

B. Using this in your mod or tweaking an existing mod:
Open the CS with the mod as the Active File and follow the steps below, then save the mod.

Steps

1. Create a new quest:
Click on the Q button, right-click in the list and add a new quest.
Name it aaaSomeQuestName so it's at the top of the list.
Make sure StartGameEnabled is checked, which it should be.
Close the window.

2. Create a new script:
Click on the pencil button, and select New from the Script menu.
Copy/type this code in the editor.

Scriptname aaaSomeQuestNameScriptBegin GameMode	Player.AddItem EditorID, 1	Player.AddSpell EditorID; repeat above as needed	StopQuest aaaSomeQuestNameEnd

Editor ID for the spell or item is listed in the Object Window, and aaaSomeQuestName is the name of your quest.

Select Quest in the Script Type drop down menu in the title bar of that window, and click the save button.
Close that window.

3. Select that script for the quest:
Click on the Q button again and select your quest (aaaSomeQuestName).
In the Script drop down, choose your script (aaaSomeQuestNameScript).
Close the window and save the mod.

Next time you play, the item(s)/spell(s) will be added automatically!
User avatar
Dona BlackHeart
 
Posts: 3405
Joined: Fri Dec 22, 2006 4:05 pm

Post » Mon May 07, 2012 6:48 am

Objective: Create a door/portal that can take you to one of several locations

This is basically along the lines of Guild Guides from Cyrodiil Transportation Network where the script is called by the mage, and is adapted from TomWithTheWeather's All-in-one Basemant mod.

Steps

1. Create a new door object by duplicating one that fits your purposes. This can be a regular door, trap door, dungeon/fort door, or even the Mage Guild Portal used in the Archmage's Tower in the Arcane University. Give the door an easy name to remember: I'm using aaaMyModPortal here.

2. Place markers where you want the portal to teleport the player to. To do this, you need to open the Cell you want to go to in the Render Window, and place an XMarkerHeading from WorldObjects>Static (XMarker works also, but doesn't show you the direction the player will face when s/he arrives). So let's say you want one of the locations to be the Chorrol Mage Guild: in the Cell View window, select Interiors and double click on ChorrolMagesGuild in the list. There's already an XMarker and an XMarkerHeading in the main room there, but you can place yours pretty much anywhere, and orient it the way you want the player to show up. Make sure it's flush with the floor, you don't want to show up in mid-air. Then double click on the marker and give it a specific name in the Reference Editor ID text box (aaaChorrolMGMarker). Close that window and go place the markers for the other locations you want your portal to go to, giving each one a unique name.

3. Create the following Object script, replacing the Location2 & Location3 with your locations & markers. Remember, you can only have 10 choices in a MessageBox; you can create sub-menus if you want more options, but let's leave that for another lesson.

ScriptName aaaMyModPortalScriptshort Button;== Display message box and options.Begin OnActivate	if IsActionRef Player == 1 		MessageBox "Where do you want to teleport to?", "Chorrol Mage Guild", "Location2", "Location3", "Cancel"	endifEnd;== Move player to location markers.Begin GameMode	set Button to getButtonPressed	if Button > -1		if Button == 0			Player.MoveTo aaaChorrolMGMarker			Return		elseif Button == 1			Player.MoveTo aaaLocation2Marker			Return		elseif Button == 2			Player.MoveTo aaaLocation3Marker			Return		elseif Button == 3			Return		endif	endifEnd

4. Attach the script to your door/portal: double click on aaaMyModPortal in the Object Window and in the Script dropdown menu select aaaMyModPortalScript.

5. Place the aaaMyModPortal where you want in the Render Window. Save and go play.

That's it!
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Mon May 07, 2012 11:30 am

Objective: Avoiding message spam

Option A - bullet-proof but has a side-effect
Message "Your message", 1;or you can make it blank, " "Message "Your message", 1;these two lines need to be exactly the sameplayer.RemoveItem ... player.AddSpell... etc.

This disables Oblivion's ability to queue messages for a few seconds (the default duration) of the message (meaning, old messages will still show up, but any new messages, from any source, after these two lines fire, will be ignored). If you need to tell the player something afterwards, I would suggest using a messagebox.

Option B - less reliable but can show messages afterwards

Write a message in the frame following the spam. For example,
set Counter to 2if Counter  message "Your message"  player.RemoveItem...  set Counter to (Counter - 1)  returnendif

Showing a message afterwards should not be a problem in and of itself. However, there are some things that will either: do nothing, display the message queue from the beginning, or display the message queue from it's current position (these two are different - when the message can safely be displayed afterwards should make a difference). So far, these things seem to include:
Having a message beforehand and then displaying a message afterwards
Having a few frames for the message to be displayed between the multiple uses
i.e., The above code is part of a OnActivate block on a container - activating that container continously and rapidly will cause the spam to be displayed (I guess this is related to the reason above)
User avatar
Justin Hankins
 
Posts: 3348
Joined: Fri Oct 26, 2007 12:36 pm

Post » Mon May 07, 2012 6:18 am

Objective: Remove Items from the Player's Inventory Quickly and Safely (Req OBSE 9a)

The quick part:
This is the standard code for taking all item's from the player's inventory using the OBSE 9 looping functions. Looping functions are still considered beta, so this code should be considered beta also (however, since the 9a fix, there doesn't seem to be any problems with it). All thanks should go to those who've worked on this before (the OBSE team, phoenix amon, and kea, and probably others).

The safe part:
No quest items are removed from the player
No Nirnroot is removed from the player (the quest adds the Nirnroot a second time when the player takes it back)
Odd stacks of items won't be left in the player's inventory (seems scripted/modified ingredients had this problem)
Won't remove equipment the player is wearing (delete && (player.GetEquipped rInvObj == 0) if you don't want this)
I'm working on avoiding onAdd blocks - I'll add it if I can get it to work. onAdd blocks will fire when added to the container.

Side effects:
If the variables on a scripted item have been set, then this will erase the set variables.
This will erase the stolen flag from all of the items.
To prevent message spam I'll use http://www.elderscrolls.com/forums/index.php?showtopic=632323&st=0&p=9176286&#entry9176286, which does have a side effect.
OnAdd blocks on each item will fire.

Options

This code is for a container. Just attach it to a container and place it in the world.
This can be used on an unplayable http://cs.elderscrolls.com/constwiki/index.php/Unplayable_Items with a few modifications. I've put in a few comments on how to set up the token script.


short Workingshort Choiceshort InvPositionshort InvTotalshort InvObjAmountref	rInvObjref	rContainer;necessary if you put this script on an item instead of a containerbegin OnActivate  if IsActionRef player == 1	messagebox "What would you like to do?" "Store Items";... whatever other options you want	DisablePlayerControls;looks smoother if you disable player controls here, just make sure to re-enable	set Working to 1	set Choice to -1	set InvPosition to (player.GetNumItems - 1)	set rContainer to GetSelf;or GetContainer for a token  endifendbegin GameMode;or MenuMode 1008	if Working != 1	  return	else	  if Choice == -1		set Choice to GetButtonPressed		return	  elseif Choice == 0;Store Items		message " ", 1		message " ", 1;leave both of these blank to remove message spam				set InvPosition to (player.GetNumItems - 1)			Label 1		if (InvPosition >= 0)		  set InvTotal to (player.GetNumItems)		  set rInvObj to (player.GetInventoryObject InvPosition)		  if (IsQuestItem rInvObj == 0) && (rInvObj != MS39Nirnroot) && (player.GetEquipped rInvObj == 0)			set InvObjAmount to (player.GetItemCount rInvObj)			if InvObjAmount > 0			  player.RemoveItem rInvObj InvObjAmount			  rContainer.AddItem rInvObj InvObjAmount			  Label 2			  if (InvTotal == player.GetNumItems)				set InvObjAmount to (player.GetItemCount rInvObj)				player.RemoveItem rInvObj InvObjAmount				Goto 2			  endif			endif		  endif		  set InvPosition to (InvPosition - 1)		  Goto 1		else		  set Working to 0		  set Choice to -1		  EnablePlayerControls		  return		endif	  elseif Choice == ...;whatever other options you want to make		...	  endif	endifend
User avatar
Katharine Newton
 
Posts: 3318
Joined: Tue Jun 13, 2006 12:33 pm

Post » Mon May 07, 2012 1:29 pm

This is a brilliant idea. I used to be a VB programmer and relied on code snippets all the time. This should be a sticky.
User avatar
Oyuki Manson Lavey
 
Posts: 3438
Joined: Mon Aug 28, 2006 2:47 am

Post » Mon May 07, 2012 4:06 pm

Objective: Create an activator that activates on Frost damage

Put your activator in the required spot and then code it thusly:
Scn MagickaActivatedshort DoOnceBegin OnActivateMessagebox "This Item will only activate when hit with a Frost spell.", "Ok"endBegin OnMagicEffectHit FRDGIf DoOnce == 0;Your code hereSet DoOnce to 1endifend

You can actually replace frost with any other type of spell but i've forgotten where the list it.

EDIT:: Found It! http://cs.elderscrolls.com/constwiki/index.php/Magic_Effects_List
Happy Coding!
$nickahz

Edit:: Just for Logam I put a period in there. BTW Logam, you made a mistake in yours too! :P You forgot to comma-ize it.
User avatar
OJY
 
Posts: 3462
Joined: Wed May 30, 2007 3:11 pm

Post » Mon May 07, 2012 6:23 pm

Nice work everyone! This is a great idea for people to post scripts and the like on how to achieve things in the CS. :)

Agree this should be stickied ^_^

EDIT: TIUM you don't need a comma :P
User avatar
Phillip Brunyee
 
Posts: 3510
Joined: Tue Jul 31, 2007 7:43 pm

Post » Mon May 07, 2012 11:50 am

Spoke with a mod and suggested that either this or a thread based on this idea be pinned.

She's looking into it.
User avatar
Star Dunkels Macmillan
 
Posts: 3421
Joined: Thu Aug 31, 2006 4:00 pm

Post » Mon May 07, 2012 5:19 am

Spoke with a mod and suggested that either this or a thread based on this idea be pinned.
Oh fine, steal my idea! :cry:

Just kidding, all credit goes to the contributors.
But if someone else is going to manage the thread, I hope they're committed.
If this thing grows, it's going to need some maintenance so it's not too hard to sift through.
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Mon May 07, 2012 10:55 am

Objective: Avoiding message spam on additem II

You need a persistence container with a unique ID placed some were in the world.
This version don't block any important messages.

scn J3XAddItemsbegin onactivate;Or something   J3XUniqeConatiner.additem J3XItems 50;Replace it with your items   J3XUniqeConatiner.removeallitems playerend



Objective: Make a activator cast a spell on the player when it's being hit with a arrow

scn J3XFantasticScriptBegin OnHitWith J3XFantasticArrow;You can skip the item Id and it will work with any arrow;)   PME ReHe;Restore Health effect   cast J3XRestoreHealthSpell playerend



Objective: Reanimates a NPC that is lying on a Altar and make it look like a ghost

Of course it don't have to be an altar, any creepy stuff will to it, just as long you can drag a NPC upon it.
Please not that this just brings the NPC back to life, no other AI or things like that.
You need : a spell & 2 activators (one invisible and one alter thing)

The altar script:
scn J3XAltarScriptref selfref casterfloat tempbegin Onload   pms effectReanimate; Adds a bit of atmosphere with a nice shader endbegin onactivate;whatever you want   set caster to placeatme J3XCaster   set temp to caster.getpos z   set temp to (temp + 200);Change this if you want to cast it indoors, like 50 or something.   set self to getself   caster.cast J3XSpell self   caster.disableend

The Scripted spell effect code:
scn J3XSpellEffectbegin onscripteffectstart   reanimate 1;Including rez animation!   addspell AbGhostNPC";Ghostly appearance!end

Edit: Added more scripts
Edit: Typos


We should add this to the CS wiki.
User avatar
ezra
 
Posts: 3510
Joined: Sun Aug 12, 2007 6:40 pm

Post » Mon May 07, 2012 5:48 pm

Oh fine, steal my idea! :cry:

Just kidding, all credit goes to the contributors.
But if someone else is going to manage the thread, I hope they're committed.
If this thing grows, it's going to need some maintenance so it's not too hard to sift through.

Felic, you and I could manage it! We are always on the forums :P
User avatar
Emmi Coolahan
 
Posts: 3335
Joined: Wed Jan 24, 2007 9:14 pm

Post » Mon May 07, 2012 9:20 am

I Could Help Manage, I'm On The Forums A Lot Daily And I Come To This Thread At Least Twice Daily, I Could Help. Besides, Felic Helped Me On My Thread, He Rocks. (And So Does His Icon.)
User avatar
biiibi
 
Posts: 3384
Joined: Sun Apr 08, 2007 4:39 am

Post » Mon May 07, 2012 7:27 am

We should add this to the CS wiki.
Yeah, some people might wonder why or be silently criticizing me for not just contributing to the CS Wiki, but I just have a hard time finding what I need there. More often than not I have to revert to posting a question on this forum. The Wiki is a great resource, but not intuitively organized for finding stuff like on this post. As this grows, it will have to be moved to a more organizable format, probably some website. But rather than try to be all encomapssing like the Wiki, I just want to make a compact modder's resource with clear categories for commonly used code snippets: Companions/Quests/Triggers/etc. It's a WiP, and your suggestions are more than welcome.

Felic, you and I could manage it! We are always on the forums :P

Thanks dude! If and when we expand this beyong a single thread, I'll be sure to remind you of your kind offer. But at this time, organization means editing my initial post, and I'm not about to share my login with anyone. :ninja:

I Could Help Manage, I'm On The Forums A Lot Daily And I Come To This Thread At Least Twice Daily, I Could Help. Besides, Felic Helped Me On My Thread, He Rocks. (And So Does His Icon.)
Only if you stop with the Title Case! :P
User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm

Post » Mon May 07, 2012 7:36 am

Thanks dude! If and when we expand this beyong a single thread, I'll be sure to remind you of your kind offer. But at this time, organization means editing my initial post, and I'm not about to share my login with anyone. :ninja:

Ofcourse, i would never ask for login details as it is against forum rules and regulations... :nono:

I meant when this gets beyond one thread or if it gets stickied or something, we could both manage it and add stuff in, ect. ^_^
User avatar
Shelby McDonald
 
Posts: 3497
Joined: Sat Jan 13, 2007 2:29 pm

Post » Mon May 07, 2012 11:15 am

scn J3XAddItemsbegin onactivate;Or something   J3XUniqeConatiner.additem J3XItems 50;Replace it with your items   J3XUniqeConatiner.removeitems player  <-- THERE --end
It should be removeallitems IIRC.

:goodjob: This is a great idea, it's much easier for people to add code a forum thread than the cswiki. It's good for gathering information, but eventually someone should copy it to the wiki.
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Post » Mon May 07, 2012 5:34 am

I don't know, the wiki is difficult to navigate. I find it easier to use the "What links here" button then to look through the tutorials/solutions/useful code/etc. I think adding this page would just add to the confusion right now.

@Felix - so should this thread be chatty? Your hyperlink solution does wonders.
User avatar
Teghan Harris
 
Posts: 3370
Joined: Mon Mar 05, 2007 1:31 pm

Post » Mon May 07, 2012 6:26 pm

Chat away! :D

What I meant with the pvssyr comment is to focus on posting snippets. Discuss the workings of a script on another thread, then post the solution here. This will allow this thread to be a repository rather than a discussion on scripting in general.

When I noticed a minor error on one of the scripts posted, I PM'd the author rather than comment on this thread. However, discussing what to do with this thread is essential, especially at this point.

@Qazaaq: People who post here can add their snippets to the wiki if they feel like it. I'm not going to do it for them.
User avatar
Kelvin
 
Posts: 3405
Joined: Sat Nov 17, 2007 10:22 am

Post » Mon May 07, 2012 5:35 am

Ojective: Simple Scripts. Fire And Teleport Spell


Two things:

1: I've stopped the caps thing ;)
2: I have a few good scripts that are kinda fun, the only problem is they are kinda' basic.

Begin ScriptEffectStart   GetFlamesEnd

See how basic they are, here's another one:
Requirements:
- A cell.
- The ability to read.

Begin ScriptEffectStart   coc "cell name here"End

- OR - (this is the better choice. Way better.)

Begin ScriptEffectStart   Player.MoveTo "markerRefID"End
where markerRefID is the name you give the XMarker or XMarkerHeading you place in the cell.


You will also have to have a teleport marker where you want to teleport to. This may used for a container cell. I am an ameteur, but hey, I might be better than some.

Lastly, can you post race things and other stuff than scripting on this thread, perhaps create a new thread for that? (by the way, this would have been here by 5:30 if i didn't have to go to the store.)
User avatar
Sammi Jones
 
Posts: 3407
Joined: Thu Nov 23, 2006 7:59 am

Post » Mon May 07, 2012 6:38 pm

Logam, don't forget me, I'll be more than happy to help manage this thread, if it gets stickied that is.
User avatar
Chrissie Pillinger
 
Posts: 3464
Joined: Fri Jun 16, 2006 3:26 am

Post » Mon May 07, 2012 3:13 pm

Comandra with the teleport spell it would be more effective to place a marker and then have the player move to that marker, otherwise with COC it could randomly place the player in buildings, ect.

Also a mark and recall script would just call an activator too the player then when you cast re-call, your player is moved to that... :)
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Mon May 07, 2012 6:16 am

Begin ScriptEffectStart   coc "cell name here"End

Something like this?

Begin ScriptEffectStart   player.moveto MarkerNameEnd
User avatar
Farrah Lee
 
Posts: 3488
Joined: Fri Aug 17, 2007 10:32 pm

Post » Mon May 07, 2012 3:56 pm

Logam & J3X, I PM'd Comandra about that right after he posted it.

EDIT: Gender fix! Sorry!!! :embarrased:
User avatar
Adam Porter
 
Posts: 3532
Joined: Sat Jun 02, 2007 10:47 am

Post » Mon May 07, 2012 4:47 pm

Something like this?

Begin ScriptEffectStart   player.moveto MarkerNameEnd

Just like that :)

Logam & J3X, I PM'd Comandra about that right after she posted it.

Oh, ok then... :P
User avatar
CHANONE
 
Posts: 3377
Joined: Fri Mar 30, 2007 10:04 am

Post » Mon May 07, 2012 7:27 am

Objective: Make a drop able misc item turn to a container when you drop it and activate it

You need a: Misc item and a container item. (and 2 scripts)
You pick up the container by sneak and activate it, it will add all items left in the container to the players inventory (no message spam :))

Misc Item Script:
scn J3XMiscItemScriptfloat tempref contbegin onactivate   set cont to placeatme J3XContainer 1   set temp to getpos x   cont.setpos x to temp   set temp to getpos y   cont.setpos y to temp   set temp to getpos z   cont.setpos z to tempend

Container Script:
scn J3XContainerScriptref selfbegin onactivate   if player.IsSneaking == 1	  set self to getself	  self.additem J3XMiscItem 1	  self.removeallitems player   else	  activate   endifend

Edit: Script errors and things like that, thanks to Haama for letting me know.
User avatar
Darlene DIllow
 
Posts: 3403
Joined: Fri Oct 26, 2007 5:34 am

Next

Return to IV - Oblivion

cron