Quick Questions -- Quick Answers, The Seventeenth

Post » Thu May 26, 2011 9:24 pm

I made a scripted menu starting with OnEquip bound to an item, and while the menu works perfectly I set it to run under MenuMode - so obviously it only runs when I "equip" it through the inventory menu. Say I wanted to include the possibility to launch the menu if the player were to "equip" the item through the hotkey system, and thus have it running under GameMode - while still retaining the MenuMode function - what's the best approach? Just copy the MenuMode block and change the copy to GameMode? :x
User avatar
RUby DIaz
 
Posts: 3383
Joined: Wed Nov 29, 2006 8:18 am

Post » Thu May 26, 2011 8:07 pm

Is there a begin block which runs evertime the actor kills someone?

Oh god, you (and we all) wish!

If it's a specific actor, you can enchant their weapon with a scripted spell/add a script effect to their spells to keep track of those that they kill, though. That should be pretty trivial...

scn KillCountIncrementshort doOnceBegin ScriptEffectUpdate	if ( doOnce )		return	endif	if ( GetDead )		set quest.variable to quest.variable + 1		set doOnce to 1	endifEnd

quest.variable holds the number of kills your character has made.
User avatar
lauraa
 
Posts: 3362
Joined: Tue Aug 22, 2006 2:20 pm

Post » Fri May 27, 2011 2:03 am

Oh god, you (and we all) wish!


Oh damn it!

Well but your idea sounds like the only solution, the problem is i want it to check it on a whole lot of actors around 40 or something, but i guess its a matter of variables xD

Thanks for telling me :D


Another question, is it possible to make a new kind menu? With images and so on? Is it difficult?
User avatar
Jennie Skeletons
 
Posts: 3452
Joined: Wed Jun 21, 2006 8:21 am

Post » Fri May 27, 2011 7:54 am

I made a scripted menu starting with OnEquip bound to an item, and while the menu works perfectly I set it to run under MenuMode - so obviously it only runs when I "equip" it through the inventory menu. Say I wanted to include the possibility to launch the menu if the player were to "equip" the item through the hotkey system, and thus have it running under GameMode - while still retaining the MenuMode function - what's the best approach? Just copy the MenuMode block and change the copy to GameMode? :x
It should work, but you'll need counter variables to prevent menu duplication. By this I mean that if you equip the item while in the inventory and the menumode version of the menu runs, you'll want to set a variable to prevent the gamemode one from also running when you exit the inventory. And vice versa, so that the menumode one doesn't run next time you open the inventory after using a hotkey and getting the gamemode one to run.

You'll also have to be sure that all necessary variables reset after either menu runs. You can probably accomplish both things with this one if the variables reset so that the other menu doesn't run.
User avatar
Helen Quill
 
Posts: 3334
Joined: Fri Oct 13, 2006 1:12 pm

Post » Fri May 27, 2011 12:44 am

Thanks showler. Good to know it works, though it's too much work to be worth it for this small mod. :p

I got another question; how do I make the player cast a self-ranged spell on himself? It's an item that, when used, is supposed to force the player to use the spell.

[...]Begin GameMode	If (ReadyToCast == 1)		Player.Cast TheSpell Player		Player.RemoveItem TheItem 1		Set ReadyToCastto 0		Return	EndIfEnd

Only causes the game to CTD... -.-
User avatar
J.P loves
 
Posts: 3487
Joined: Thu Jun 21, 2007 9:03 am

Post » Thu May 26, 2011 10:20 pm

It's probably not that much work. Depending on how the variables reset, just copying the menu section to gamemode may work as is. I'd say it's worth a try.

For the spell. Does it compile without a target? Self-range spells shouldn't need a target, but the script may need it since it doesn't know it's a self-range spell.

The problem is likely the "RemoveItem" if TheItem is the object that this script is on. If you are getting rid of the object entirely, thhen try deleting that line and replace "Return" with "RemoveMe"
User avatar
clelia vega
 
Posts: 3433
Joined: Wed Mar 21, 2007 6:04 pm

Post » Fri May 27, 2011 7:51 am

/facepalm

Yeah, removing the item that the script is on will cause a CTD. Can't believe I missed that. And as you said, the CS requires a target for the spell regardless of the spell range.

Thanks again, I got it to work now! One more thing though; I got the script attached to a misc. item and it now works so that it gets used and then removed. But I have more then one of these items, and the problem is that if I hotkey the item it gets removed from the hotkey as one of the items in the stack is removed. Is there a way around this or should I use another item type, such a potion?
User avatar
Reanan-Marie Olsen
 
Posts: 3386
Joined: Thu Mar 01, 2007 6:12 am

Post » Fri May 27, 2011 4:57 am

Alright, quick question. Can you activate a script from another script? As in have a line in Script A that will force Script B to run. Not just changing a global or similar in script A so that an if statement in script B becomes true. I've been trying to search this for awhile and the 4 letter min limit on the search function here is making it really really frustrating =/
User avatar
elliot mudd
 
Posts: 3426
Joined: Wed May 09, 2007 8:56 am

Post » Fri May 27, 2011 6:00 am

Other than creating another item to act as a permanent Hotkey item (like OOO does with a torch hotkey item), I'm not sure if there's another solution.

You could, I suppose, include a section of script to scan the vanilla hotkeys as the item is used, and then have a quest script set that hotkey to the item stack again. That's an OBSE function, though, and I don't think it can affect hotkeys from hotkey mods.
User avatar
marie breen
 
Posts: 3388
Joined: Thu Aug 03, 2006 4:50 am

Post » Thu May 26, 2011 10:09 pm

Alright, quick question. Can you activate a script from another script? As in have a line in Script A that will force Script B to run. Not just changing a global or similar in script A so that an if statement in script B becomes true. I've been trying to search this for awhile and the 4 letter min limit on the search function here is making it really really frustrating =/
A couple of ways, depending on what you want to do and whether you are using OBSE.

Simplest way, make the script a quest script, attach it to a quest "ScriptBQuest", set the quest with "start game enabled" turned OFF and "Allow Repeated Stages" turned ON. In Script A add a line "startquest ScriptBQuest". In the quest script end it with "Stopquest ScriptBQuest".

Alternate method, make an object that's a persistent reference "ScriptBObjectRef", attach the script to it with an OnActivate block, In Script A add a line "ScriptBObjectRef.activate Player, 1". If necessary, precede that line with "ScriptBObjectRef.moveto Player, 0, 0, -200" to bring the object to you before activating.

OBSE method: Use "RunBatchScript" to run a script stored in a batch file in the Oblivion directory.
User avatar
Heather Kush
 
Posts: 3456
Joined: Tue Jun 05, 2007 10:05 pm

Post » Fri May 27, 2011 12:12 am

Is there a good guide somewhere for having two installs of Oblivion? A playing version and a bare bones modding version?
User avatar
Nicole M
 
Posts: 3501
Joined: Thu Jun 15, 2006 6:31 am

Post » Fri May 27, 2011 1:58 am

Is there a good guide somewhere for having two installs of Oblivion? A playing version and a bare bones modding version?

About a year ago, BigBen, at the Nexus Forums, explained how he did it.
It was really simple, when you saw it. I only remember he used a couple of .bat files.
Maybe if you ask him there . . .
User avatar
Flesh Tunnel
 
Posts: 3409
Joined: Mon Sep 18, 2006 7:43 pm

Post » Fri May 27, 2011 5:22 am

I'm gonna continue my tradition of weird questions.

If you are being chased by a creature, and it can't operate doors, and you go through a door, does the creature stop following immediately, or does it run all the way up to the door?

QQuix, thanks, I'm looking on the TESNexus forums now. Lotta BigBen's there, though, and the forum doesn't seem to keep track of posts so I can't even tell who's a regular poster and who's an occasional poster.
User avatar
Annick Charron
 
Posts: 3367
Joined: Fri Dec 29, 2006 3:03 pm

Post » Thu May 26, 2011 10:13 pm

I meant the moderator who loves to help people. Real nice guy. I forgot that his nickname is, actually, bben46. Sorry about that.

Search for keyword 'bat' and filter by username bben46; There are several posts where he talks about Dual Oblivion.
User avatar
Claudia Cook
 
Posts: 3450
Joined: Mon Oct 30, 2006 10:22 am

Post » Fri May 27, 2011 12:28 am

A google search eventually turned up his post. Sounds like a good idea, I just can't remember at the moment if you can do batch files in Win7.

I'll think of something, though, since his post gives the important information on how to fool windows.
User avatar
Matthew Warren
 
Posts: 3463
Joined: Fri Oct 19, 2007 11:37 pm

Post » Thu May 26, 2011 9:23 pm

I just can't remember at the moment if you can do batch files in Win7.
You can.

I use Wrye Bash's Profiles feature to switch b'ween my mod and play-test setup. Quite simple and doesn't require a 2nd installation.
User avatar
Matt Gammond
 
Posts: 3410
Joined: Mon Jul 02, 2007 2:38 pm

Post » Thu May 26, 2011 11:22 pm

Bump question

Is it possible to make a new kind menu? like the ingredient menu, or is it possible to show pictures in messageboxes?
User avatar
phil walsh
 
Posts: 3317
Joined: Wed May 16, 2007 8:46 pm

Post » Fri May 27, 2011 9:26 am

I don't think that you should have the timer check with both a <= and a >= at the end there.

Otherwise, it looks reasonably good. I assume the fire trap is set as the parent of the trigger zone, and that they are set to use opposite states of enable?

I'd try adding some debug messages through the code to see if everything in the script is working, or where it is failing.


That's the one I got from the CS wiki. I'll work on it later, though that enable opposite state thing might be another thing.
User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am

Post » Fri May 27, 2011 4:59 am

Bump question

Is it possible to make a new kind menu? like the ingredient menu, or is it possible to show pictures in messageboxes?
Probably, but you'd need to know some XML and have to use some OBSE UI functions.

I don't know if you can add a new menu entirely, or change messagebox menu dynamically enough to accomplish this, but you might be able to build a new version of the messagebox with spaces for images, but have the images set to invisible by default and only turn them on when you need to.
User avatar
Lily Evans
 
Posts: 3401
Joined: Thu Aug 31, 2006 11:10 am

Post » Thu May 26, 2011 9:59 pm

I need the player to get 10 gold rewarded through dialogue for each special rat he has killed. How can I do this, without creating a unique line for each amount of possible dead rats? I tried 'player.additem gold001 PovRatskilled' where PovRatskilled is a short global which increases by 10 for each rat killed. The script doesn't give an error, but I'm not getting the gold either. The global is updating properly.

Is there a better way to do this?
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm

Post » Thu May 26, 2011 8:51 pm

If you use a quest variable in another script, you'll need to use questname.variable to access it.
User avatar
Alyesha Neufeld
 
Posts: 3421
Joined: Fri Jan 19, 2007 10:45 am

Post » Fri May 27, 2011 1:06 am

How do I make male characters of my custom race have a different face texture to female characters?
User avatar
Jade Payton
 
Posts: 3417
Joined: Mon Sep 11, 2006 1:01 pm

Post » Fri May 27, 2011 1:48 am

If you use a quest variable in another script, you'll need to use questname.variable to access it.

Thanks, it's working now. :thumbsup:
User avatar
Joie Perez
 
Posts: 3410
Joined: Fri Sep 15, 2006 3:25 pm

Post » Fri May 27, 2011 2:12 am

How do I make male characters of my custom race have a different face texture to female characters?

By creating two custom races.

There is no other way. Face textures are shared.
User avatar
Ronald
 
Posts: 3319
Joined: Sun Aug 05, 2007 12:16 am

Post » Thu May 26, 2011 10:19 pm

EDIT: Got a better question.

Is there a script syntax that returns 1 if it's daytime?

Pseudo-code:
If Daytime == 1
User avatar
..xX Vin Xx..
 
Posts: 3531
Joined: Sun Jun 18, 2006 6:33 pm

PreviousNext

Return to IV - Oblivion