[BETA] Oblivion Script Extender (OBSE) 0020

Post » Mon May 02, 2011 7:00 pm

I'm not sure this wouldn't be any different than this:
Thanks for the idea, but the enemy who's health is displayed in the health bar, is often outside activation range, and will therefore not be returned by GetCrosshairRef. Enemies attacked by bows or magic are typcially not catched by your method.

I do have a method that works fairly well, but for completeness sake would like the option to always display health bar for the same reference as the vanilla health bar.
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Tue May 03, 2011 1:57 am

Have you received any reports of GetOBSEVersion and/or GetOBSERevision causing the script to fail like running a return statement?

This doesn't happen for me but other people have reported it. It seems like this can occur on both obse 19 and obse 20 beta, and getting people to switch versions sometimes fixes the problem. Users who had this problem also mentioned they were using other obse mods without any problems so I'm not sure what's causing it.
User avatar
c.o.s.m.o
 
Posts: 3419
Joined: Sat Aug 12, 2006 9:21 am

Post » Tue May 03, 2011 10:02 am

Have you received any reports of GetOBSEVersion and/or GetOBSERevision causing the script to fail like running a return statement?

This doesn't happen for me but other people have reported it. It seems like this can occur on both obse 19 and obse 20 beta, and getting people to switch versions sometimes fixes the problem. Users who had this problem also mentioned they were using other obse mods without any problems so I'm not sure what's causing it.

Nope. Really can't think of any reason why those cmds would fail unless OBSE is not loaded.
Please point me to the bug reports.
User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm

Post » Mon May 02, 2011 7:48 pm

Carried over from the previous thread.

@PimpSkinny: PM me a link to the mod and info on reproducing the issue. Both commands are working here in quick tests.


I'd asked about GetCreatureType and IsFlying. GetCreatureType seems to be working. That was my mistake. But IsFlying still doesn't. This target spell ...

Scn IsFlyingTestScrFloat FlyingBegin ScriptEffectStart      Set Flying to IsFlying      Message "Flying is %.1f.", FlyingEnd


... returns 0.0 for everything I cast it at including Ghosts and Imps. I'm guessing creatures like Ghosts and Imps are the purpose of this function.
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Tue May 03, 2011 10:51 am

I'd asked about GetCreatureType and IsFlying. GetCreatureType seems to be working. That was my mistake. But IsFlying still doesn't. This target spell ...

Are you trying to determine if a creature is of a flying type, or if it is *currently* flying?
Use GetCreatureFlies to find out if the creature can fly. It will return 1 for imps, ghosts, etc - anything that has the "Flies" box checked in the editor.
I'm not sure IsFlying is actually useful - it is based on a Havok enumerated value that may not be used by the game.
User avatar
Courtney Foren
 
Posts: 3418
Joined: Sun Mar 11, 2007 6:49 am

Post » Mon May 02, 2011 10:23 pm

Nope. Really can't think of any reason why those cmds would fail unless OBSE is not loaded.
Please point me to the bug reports.


Ok, see http://www.thenexusforums.com/index.php?/topic/246215-curse-of-hircine-resurrected-endorsemants/page__view__findpost__p__2804845 and down.

Edit: And http://www.thenexusforums.com/index.php?/topic/246215-curse-of-hircine-resurrected-endorsemants/page__view__findpost__p__2550758 is a different post.
User avatar
Peetay
 
Posts: 3303
Joined: Sun Jul 22, 2007 10:33 am

Post » Tue May 03, 2011 9:59 am

Ok, see http://www.thenexusforums.com/index.php?/topic/246215-curse-of-hircine-resurrected-endorsemants/page__view__findpost__p__2804845 and down.

Edit: And http://www.thenexusforums.com/index.php?/topic/246215-curse-of-hircine-resurrected-endorsemants/page__view__findpost__p__2550758 is a different post.


Actually I just finished reworking my OBSE check. Basically I used the http://cs.elderscrolls.com/constwiki/index.php/Combine_your_SI_and_non-SI_mods_into_one_%28OBSE,_Patch_v1.1,_Other_mods_too%29, but modified it to check for the revision as well. I also moved it outside the getGameLoaded check! getGameLoaded is an OBSE function, so it won't work if OBSE isn't loaded. I found my new check now works if OBSE isn't loaded at all - like the cases with Steam users not having the in-game community flag checked. Might be something to look into.

I know it sounds silly now, but I didn't write the original script. When I was doing some testing I couldn't figure out why I wasn't getting a warning when OBSE wasn't installed at all. Then I took a closer look at the script and discovered that the check had been misplaced.
User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Post » Tue May 03, 2011 5:32 am

Are you trying to determine if a creature is of a flying type, or if it is *currently* flying?
Use GetCreatureFlies to find out if the creature can fly. It will return 1 for imps, ghosts, etc - anything that has the "Flies" box checked in the editor.
I'm not sure IsFlying is actually useful - it is based on a Havok enumerated value that may not be used by the game.


Ahh Thank you! That's what I needed. :foodndrink:

... Edit: Ahh crap. Ghosts aren't marked "Flies" in the CS so it returns 0 for Ghosts. Geez - nothin' is easy. Maybe a way for me to see if the Actor has the "water walking" ability? Even if it's wrapped up with other affects? Like for Ghost, it's included in their resistances ability.

Imps returned 1, so that's good at least.
User avatar
Elle H
 
Posts: 3407
Joined: Sun Aug 06, 2006 3:15 am

Post » Tue May 03, 2011 3:16 am

Request: Same chance as getting permanent versions of other non-permanent OBSE commands - it's a matter of setting up the infrastructure to record changes and manage them properly based on changing load orders.

I see... So I guess I'll take that as a 'no, not right now'.
Anyway thanks for the clarification on the forEach loops.

Also, it seems that using sv_ToNumeric inside a compiler override block will cause the script to not compile.

Script:
Spoiler
Scn aaGetPathData;==============================;|		Local Variables	|;==============================short		isNumeric		array_var	arSetAstring_var	subStringstring_var	char;==============================;|		Arguments	|;==============================string_var	pathArgBegin _Function {pathArg}	setFunctionValue -1	if eval (pathArg == "")		return	endif	forEach (arSetA <- (sv_split pathArg "\"))		let subString := arsetA["value"]		let isNumeric := 1				forEach (char <- subString)			if eval !(IsDigit (CharToASCII char))				let isNumeric := 0				break			endif		loop		if (isNumeric)			setFunctionValue sv_ToNumeric subString			break		endif	loopEnd

Error message:
Spoiler
Invalid expression for parameter 1. Expected stringVar

=== Edit ===

Ok... simply replacing subString with arsetA["value"] lets me compile the script, and yet if I replace subString with a string literal it won't compile...
User avatar
April D. F
 
Posts: 3346
Joined: Wed Mar 21, 2007 8:41 pm

Post » Mon May 02, 2011 8:24 pm

Actually I just finished reworking my OBSE check. Basically I used the http://cs.elderscrolls.com/constwiki/index.php/Combine_your_SI_and_non-SI_mods_into_one_%28OBSE,_Patch_v1.1,_Other_mods_too%29, but modified it to check for the revision as well. I also moved it outside the getGameLoaded check! getGameLoaded is an OBSE function, so it won't work if OBSE isn't loaded. I found my new check now works if OBSE isn't loaded at all - like the cases with Steam users not having the in-game community flag checked. Might be something to look into.


Thanks for the link. Actually, the script in the original mod works just fine so I haven't had to modify it, and it doesn't use GetGameLoaded. The error usually indicates that obse isn't installed correctly. It's just that there's <1% of users who seem to have obse installed correctly who still receive the error. I thought that I would mention it just in case.
User avatar
Craig Martin
 
Posts: 3395
Joined: Wed Jun 06, 2007 4:25 pm

Post » Tue May 03, 2011 3:10 am

Maybe a way for me to see if the Actor has the "water walking" ability?

Heh, don't even need OBSE for that: http://cs.elderscrolls.com/constwiki/index.php/HasMagicEffect is a default function.
User avatar
yermom
 
Posts: 3323
Joined: Mon Oct 15, 2007 12:56 pm

Post » Tue May 03, 2011 12:09 am

Also, it seems that using sv_ToNumeric inside a compiler override block will cause the script to not compile.

sv_* commands expect a string_var, not a string literal or anything else. Those commands pre-date the more recent fuller integration of strings/arrays into the language and treat string_var's as integer IDs. Prefer the newer commands - they are more flexible. In this case, use ToNumber.
User avatar
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am

Post » Tue May 03, 2011 5:34 am

Hey guys! Got an idea about what the next big thing OBSE could do - How hard would it be to implement fully custom menus? Not the messagebox stuff, but creating an xml menu and then call it up through an OBSE script? It would probably be a good idea to additionally include a xml tag to the reader library too, so that it executes scripts written in the xml upon certain conditions.
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am

Post » Mon May 02, 2011 7:58 pm

Hey guys! Got an idea about what the next big thing OBSE could do - How hard would it be to implement fully custom menus? Not the messagebox stuff, but creating an xml menu and then call it up through an OBSE script? It would probably be a good idea to additionally include a xml tag to the reader library too, so that it executes scripts written in the xml upon certain conditions.

Might want to check out kyoma's MenuQue plugin.
User avatar
SUck MYdIck
 
Posts: 3378
Joined: Fri Nov 30, 2007 6:43 am

Post » Tue May 03, 2011 6:15 am

Hey guys! Got an idea about what the next big thing OBSE could do - How hard would it be to implement fully custom menus? Not the messagebox stuff, but creating an xml menu and then call it up through an OBSE script? It would probably be a good idea to additionally include a xml tag to the reader library too, so that it executes scripts written in the xml upon certain conditions.

http://www.tesnexus.com/downloads/file.php?id=32200 MenuQue already does that.

EDIT: Ninja'd
User avatar
James Wilson
 
Posts: 3457
Joined: Mon Nov 12, 2007 12:51 pm

Post » Mon May 02, 2011 8:20 pm

Of course, I wasn't aware MenuQue did fully custom menus though...
User avatar
hannaH
 
Posts: 3513
Joined: Tue Aug 15, 2006 4:50 am

Post » Tue May 03, 2011 1:06 am

Of course, I wasn't aware MenuQue did fully custom menus though...

It offers some pretty impressive features. I'm not sure exactly how much freedom it gives you to define custom menus but it remains under active development, so kyoma is probably the guy to talk to.
User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Post » Mon May 02, 2011 9:06 pm

It offers some pretty impressive features. I'm not sure exactly how much freedom it gives you to define custom menus but it remains under active development, so kyoma is probably the guy to talk to.


It gives you all the freedom you need, I'm adding a completely custom GUI to Advanced Magecraft, and I'm very happy with MenuQue. :)

On point, if you want to investigate a mod for hotkey issues, try mine, I get sporadic reports of it failing to work for ppl, and the code is probably the most simple you will find. What's makes it a good candidate, is that I experienced the hotkey issue myself using this code, and now, it works perfectly fine for me, but, the code itself didn't change one bit.. (I'm using OBSE v20 Beta5...)

Here is the entire block in question..

SCN aaaAdvancedMagecraftSCRBegin MenuMode	if ( MenuMode 1002 || MenuMode 1022 )		if ( IsKeyPressed2 aaaMenuHotkey ) ; It was failing here, when it did..			if ( IsHotKeyPressed == 0 ) ; It never got here, I was spamming PrintC's at each point..				Set IsHotKeyPressed to 1				Call menuMenuController			endif		endif	endifEnd


--------------

Edit: My mods also very easy to use, just install it, load it up, open you inventory, hover the mouse over an item, and press "Spacebar", and you just activated the code above.. :)
User avatar
BrEezy Baby
 
Posts: 3478
Joined: Sun Mar 11, 2007 4:22 am

Post » Tue May 03, 2011 2:34 am

SCN aaaAdvancedMagecraftSCRBegin MenuMode	if ( MenuMode 1002 || MenuMode 1022 )		if ( IsKeyPressed2 aaaMenuHotkey )			if ( IsHotKeyPressed == 0 )				Set IsHotKeyPressed to 1				Call menuMenuController			endif		endif	endifEnd



Do this instead:
SCN aaaAdvancedMagecraftSCRBegin MenuMode	if ( MenuMode 1002 || MenuMode 1022 )		if ( IsKeyPressed2 aaaMenuHotkey && IsHotKeyPressed != aaaMenuHotkey )			Set IsHotKeyPressed to aaaMenuHotkey			Call menuMenuController		... elseif ( IsKeyPressed2 aaaOtherHotkey && IsHotKeyPressed != aaaOtherHotkey )		...	Set IsHotKeyPressed to aaaOtherHotkey		...	etc...		elseif ( IsKeyPressed2 IsHotKeyPressed == 0 )			Set IsHotKeyPressed to 0		endif	endifEnd


This makes it so that if the key is pressed, it only works until you either change keys, or let go of it. Also, the elseif in front of the ...'s is so you can add more. If none of the keys you're looking for are pressed, IsHotKeyPressed goes to 0 and you can test again. It'll also catch instant changes to other keys as well, so say pushing A, then D and then letting go of A while D is still down. You'll see the D next. Not a pretty solution, but it's been rock solid over all of the versions of OBSE that offered IsKeyPressed... Another great thing about it is, IsHotKeyPressed will have the currently held down hotkey, so you could even test and do code for it later in the script.

GuruSR.
User avatar
Skrapp Stephens
 
Posts: 3350
Joined: Mon Aug 06, 2007 5:04 am

Post » Tue May 03, 2011 10:45 am

Do this instead:
SCN aaaAdvancedMagecraftSCRBegin MenuMode	if ( MenuMode 1002 || MenuMode 1022 )		if ( IsKeyPressed2 aaaMenuHotkey && IsHotKeyPressed != aaaMenuHotkey )			Set IsHotKeyPressed to aaaMenuHotkey			Call menuMenuController		... elseif ( IsKeyPressed2 aaaOtherHotkey && IsHotKeyPressed != aaaOtherHotkey )		...	Set IsHotKeyPressed to aaaOtherHotkey		...	etc...		else			Set IsHotKeyPressed to 0		endif	endifEnd


This makes it so that if the key is pressed, it only works until you either change keys, or let go of it. Also, the elseif in front of the ...'s is so you can add more. If none of the keys you're looking for are pressed, IsHotKeyPressed goes to 0 and you can test again. It'll also catch instant changes to other keys as well, so say pushing A, then D and then letting go of A while D is still down. You'll see the D next. Not a pretty solution, but it's been rock solid over all of the versions of OBSE that offered IsKeyPressed... Another great thing about it is, IsHotKeyPressed will have the currently held down hotkey, so you could even test and do code for it later in the script.

GuruSR.


Well, under normal situations I would do it like that, however, this is special code that needs to be like it is. (I'm intentionally blocking the key while my mod does stuff, I release it later, when it's safe for the key to be pressed again..)

Thanks though. :)
User avatar
Matthew Barrows
 
Posts: 3388
Joined: Thu Jun 28, 2007 11:24 pm

Post » Tue May 03, 2011 6:31 am

Well, under normal situations I would do it like that, however, this is special code that needs to be like it is. (I'm intentionally blocking the key while my mod does stuff, I release it later, when it's safe for the key to be pressed again..)

Thanks though. :)

Actually, I missed some code on the last else in there (edited it to add it), makes it reset only *if* the key is let go. But you could also surround that by an If statement as well to block the tests. But that code there will work for any hotkey gathering.

GuruSR.
User avatar
Adam Porter
 
Posts: 3532
Joined: Sat Jun 02, 2007 10:47 am

Post » Mon May 02, 2011 11:47 pm

... v2.1 requires CSE(Well, for making changes..)...
A bit off-topic, but could you please clarify ? Plugins created with CSE [enabled] can be modified in the vanilla CS.
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Tue May 03, 2011 8:47 am

A bit off-topic, but could you please clarify ? Plugins created with CSE [enabled] can be modified in the vanilla CS.


;
; This script may contain preprocessor directives parsed by the CSE Script Editor. Refrain from modifying it in the vanilla editor.
; 52
;


You said it, not me..

---

Edit: Oh, I remember why I came back, Scruggsy, GetObjectType type 70 (inventory objects) doesn't seem to get all of them, it misses books, and ingredients, etc,.(it may not have worked at all, I already have code catching other types.) ( I was trying to filter out objects the player shouldn't interact with, and that seemed the way to go, but perhaps not.. I'm using GetActiveMenuSelection to select items in the inventory\spell list\etc,..)

Here, this is what I'm doing, it's much clearer in code..

Spoiler

	Set Item to ( GetActiveMenuSelection )	; IsSpell - Open Spell Menu	if ( GetMagicItemType Item == 1 )		CloseAllMenus		Set aaaMenuQST.Item to Item		Let aaaMenuQST.MenuFunction := menuSpell		Set aaaMenuQST.GenericMenu to 1		Return		endif	; Learn Spell	if ( IsScroll Item )		CloseAllMenus		Set aaaMenuQST.Item to Item		Let aaaMenuQST.MenuFunction := menuLearnSpell		Set aaaMenuQST.GenericMenu to 1		Return	endif	; Disensoul	if ( IsSoulgem Item )		CloseAllMenus		Set aaaMenuQST.Item to Item		Let aaaMenuQST.MenuFunction := guiDisensoul		Set aaaMenuQST.GenericMenu to 1		Return	endif	; Enchanting	if ( IsClothing Item || IsWeapon Item || IsArmor Item || IsAmmo Item )		CloseAllMenus		Set aaaMenuQST.Item to Item		Let aaaMenuQST.MenuFunction := menuEnchanting		Set aaaMenuQST.GenericMenu to 1		Return	endif	; Misc. Items	if (GetObjectType Item == 70) ; Basically a catch all for any remaining valid inventory objects..		CloseAllMenus		Set aaaMenuQST.Item to Item			Let aaaMenuQST.MenuFunction := guiItems		Set aaaMenuQST.GenericMenu to 1	endif	; Must Be Invalid (Debugging)	MessageEx "Invalid Selection: %z" Item	Call aaaReleaseHotkey


User avatar
Zoe Ratcliffe
 
Posts: 3370
Joined: Mon Feb 19, 2007 12:45 am

Post » Tue May 03, 2011 10:03 am

;
; This script may contain preprocessor directives parsed by the CSE Script Editor. Refrain from modifying it in the vanilla editor.
; 52
;


You said it, not me..
Ah, that wayward warning. You don't need to worry about it - It only applies if you are using the preprocessor. And even if you did, you only need to take care not to modify the serialization data CSE adds to the scripts. The next build should make the preprocessor much easier to work with.
User avatar
mimi_lys
 
Posts: 3514
Joined: Mon Apr 09, 2007 11:17 am

Post » Tue May 03, 2011 5:11 am

Ah, that wayward warning. You don't need to worry about it - It only applies if you are using the preprocessor. And even if you did, you only need to take care not to modify the serialization data CSE adds to the scripts. The next build should make the preprocessor much easier to work with.


Alright, well that's good to know.. :)

-----------

Edit: I hate this site...

If it's not logging me out when I'm trying to post, it's for some reason blocking my IP, it's nothing but annoyance, from now on, I'm only coming here when I have no choice... (If at all..)

Another thing, my warning level is still 25%, it's been like five years, and all I did was say one cuss word... WTF?

You're about to hear all of them in a big long string, whoever is responsible for this BS..

That's why, I'm done, catch me at the Nexus from now on.. (I might start using PES again..)
User avatar
Becky Cox
 
Posts: 3389
Joined: Thu Jun 22, 2006 8:38 am

PreviousNext

Return to IV - Oblivion