Scropiting help;

Post » Fri Apr 09, 2010 6:31 pm

Hi, I am looking at making a mod that individually changes the price of items that merchants sell, depending on where they are. Much like what EE for OB did but I am going to attach a script to each NPC as FOSE doesn't have the functions OBSE does for EE.

So is there a SetPrice script or such like?
User avatar
Lori Joe
 
Posts: 3539
Joined: Tue Jun 20, 2006 6:10 am

Post » Fri Apr 09, 2010 11:03 am

FOSE's http://fose.silverlock.org/fose_command_doc.html#SetBaseItemValue sounds like it should do the trick.

P.S. What is "EE" short for? Not all of us here are familiar with many Oblivion mods.

Cipscis
User avatar
Claudz
 
Posts: 3484
Joined: Thu Sep 07, 2006 5:33 am

Post » Fri Apr 09, 2010 8:45 am

Thanks, and http://www.tesnexus.com/downloads/file.php?id=25078 is EE.
User avatar
Mistress trades Melissa
 
Posts: 3464
Joined: Mon Jun 19, 2006 9:28 pm

Post » Fri Apr 09, 2010 2:46 am

Can someone tell me what's wrong with this script please??

Thanks :D

Begin MenuMode 1053	if Player.GetInCell Megaton == 1	SetBaseItemValue 00015169 2000	endifEnd

User avatar
Krystal Wilson
 
Posts: 3450
Joined: Wed Jan 17, 2007 9:40 am

Post » Fri Apr 09, 2010 9:15 am

I'm not sure if using form ID's for objects in script will work. I do know that you can use the actual editor ID, though. At a minimum, it will make your code easier to read.
User avatar
Nathan Maughan
 
Posts: 3405
Joined: Sun Jun 10, 2007 11:24 pm

Post » Fri Apr 09, 2010 2:40 am

You probably won't see the changes if you change it during barter. You'll want to call that before the player enters the trade window.
User avatar
Syaza Ramali
 
Posts: 3466
Joined: Wed Jan 24, 2007 10:46 am

Post » Fri Apr 09, 2010 3:50 pm

Tried this:

Begin GameMode	if((Player.GetInCell Megaton == 1) && (GetValue stimpak != 2000))	SetBaseItemValue stimpak 2000	endifEnd


And still nothing. Any suggestions?

By the way I am trying to make a mod that changes prices based on location, and this is just a test so far.
User avatar
Sweets Sweets
 
Posts: 3339
Joined: Tue Jun 13, 2006 3:26 am

Post » Fri Apr 09, 2010 6:36 am

I'm going to try it myself, becasue it looks right to me. Is your script running as a quest script?
User avatar
Dawn Porter
 
Posts: 3449
Joined: Sun Jun 18, 2006 11:17 am

Post » Fri Apr 09, 2010 7:44 am

Yeah it is,

my full script so far just sets the quest to the right stage then does this, but nothing happens. The stage setting works, just not this bit.
User avatar
e.Double
 
Posts: 3318
Joined: Tue Jul 24, 2007 11:17 pm

Post » Fri Apr 09, 2010 10:24 am

Is the name of the cell simply "megaton" ? I would think you would want the GetinCell to be the specific shop. :shrug:
User avatar
Dan Scott
 
Posts: 3373
Joined: Sun Nov 11, 2007 3:45 am

Post » Fri Apr 09, 2010 2:04 pm

Tried it with MegatonClinic, still didn't work though. The GECK wiki says that the GetInCell works for any cell beginning with "Megaton" though, so it should have worked.
User avatar
Jamie Lee
 
Posts: 3415
Joined: Sun Jun 17, 2007 9:15 am

Post » Fri Apr 09, 2010 9:53 am

I got it to work, but not with stimpaks. I did change the value of the 556 ammo, though. My guess is that the value of stimpaks is a "potion value" which must not be the same as the "value" for other inventory objects.
User avatar
JAY
 
Posts: 3433
Joined: Fri Sep 14, 2007 6:17 am

Post » Fri Apr 09, 2010 2:01 pm

Ah, ok, thanks.

That's a start at least.

Now, is there a way to change potion values, and is there a way to change all types yet, or will I need to wait till FOSE catches up with OBSE??
User avatar
Marine Arrègle
 
Posts: 3423
Joined: Sat Mar 24, 2007 5:19 am

Post » Fri Apr 09, 2010 5:35 pm

I can't think of any, sorry. The only command I know of to set a value is the FOSE one we have been using. But it seems to work on only one record type, which Ingestibles are not a member of.
For a limited case, you could script a vendor to remove his stimpaks and replace them with a more valuable version. But that gets hairy for the big picture.
User avatar
Glu Glu
 
Posts: 3352
Joined: Sun Apr 01, 2007 5:39 am

Post » Fri Apr 09, 2010 3:25 am

It gets hairy indeed,

hopefully the FOSE team will be able to add in the change potion price functionality soon.

There is always the option of giving the player more or less caps depending on the supposed price, i.e. if in Megaton player gets 10 caps or somewhat.
User avatar
Ashley Hill
 
Posts: 3516
Joined: Tue Jul 04, 2006 5:27 am

Post » Fri Apr 09, 2010 12:40 pm

You could add a script to the container.

Int iCountRef rContainerBegin OnReset	Set rContainer to GetSelf 	Set iCount to rContainer.GetItemCount Widget	rContainer.RemoveItem Widget iCount	rContainer.AddItem Sprocket iCountEnd


Or you could push an activator under the floor with an OnLoad block to swap stuff out.
User avatar
JR Cash
 
Posts: 3441
Joined: Tue Oct 02, 2007 12:59 pm

Post » Fri Apr 09, 2010 11:28 am

This isn't related to the OP but thought I would save on making a new post anyway.

On the oblivion wiki it says

The CellName has to be a valid interior cell name. Exterior cells will not work. In some cases, it is necessary to create a "dummy" interior cell (e.g. Chorrol) in order to use GetInCell for a set of related interior and exterior cells (e.g. all the ChorrolXXX cells).


So if I created dummy interior cells, would the GetInCell function also return a 1 if it was in an exterior cell with the same beginning??

Thanks.
User avatar
Tinkerbells
 
Posts: 3432
Joined: Sat Jun 24, 2006 10:22 pm

Post » Fri Apr 09, 2010 7:36 am

From your own quote, it says that exterior cells won't work. You have to use http://cs.elderscrolls.com/constwiki/index.php/GetInWorldspace.
User avatar
Miss K
 
Posts: 3458
Joined: Sat Jan 20, 2007 2:33 pm

Post » Fri Apr 09, 2010 5:16 pm

What about the bit that say

in order to use GetInCell for a set of related interior and exterior cells (e.g. all the ChorrolXXX cells).

User avatar
Alexis Estrada
 
Posts: 3507
Joined: Tue Aug 29, 2006 6:22 pm

Post » Fri Apr 09, 2010 2:56 pm

I have quit using getincell. Sometimes it is as though the check fails for no good reason. Getinzone always seems to work though.
User avatar
sarah
 
Posts: 3430
Joined: Wed Jul 05, 2006 1:53 pm

Post » Fri Apr 09, 2010 4:44 pm

@JustinOther:
It's a bad idea to use http://geck.gamesas.com/index.php/GetSelf in that way. Not only will it decrease the script's efficiency, it will also prevent the script from working with references saved within the save game (for example, references created via http://geck.gamesas.com/index.php/PlaceAtMe) as http://geck.gamesas.com/index.php/GetSelf will return 0 when called on these references. http://geck.gamesas.com/index.php/GetSelf should only ever be used when either passing information to another script, or when the scripted reference's refID needs to be passed to a function as a parameter (such as with http://geck.gamesas.com/index.php/PushActorAway).

Cipscis
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm


Return to Fallout 3