The Elder Scrolls Forums

TES Construction Set and Plugins >> General TES Construction Set

Pages: 1
Patrograd2
Curate

Reged: 02/02/04
Posts: 564
Loc: England
A Couple of things I have noticed
      #2646584 - 06/02/04 01:03 AM

Firstly, if you put a script onto an item that can be carried, and that script includes a messagebox, you might find when the player later sells that item/has it removed from their inventory, that the messagebox appears in the dialogue of the NPC you sell it to/takes it from you.

I had a scirpt on an amulet you were searching for, that basically told you if you were getting close to it. When you hand over that amulet to the quest giver, you get, in white writing at the bottom of the dialogue

Amulet is removed from your inventory
Your journal has been updated
You feel you are getting close to your goal, what is that glinting on the floor?

Wierd. Fixed by putting this messagebox onto a nearby urn.

Another thing I have found is that the (OnDeath) function is a little buggy. If the NPC has just taken a health potion before dying, then there is a chance that the OnDeath wont be set to 1. Its perhaps a small chance, but nonetheless it does exist. Using (GetHealth < 1 ) doesnt work any better.

The script I use is

if ( OnDeath == 1 )
Journal such and such
endif

the answer, presumably, is not to give such NPCs health potions

--------------------
City of Thieves: In Development

Creator of DeathTrap Dungeon
Download Deathtrap Dungeon Version 1.3 here:
http://mwsource.com/center/pafiledb.php?action=file&id=1041


Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Klinn
Disciple

Reged: 11/20/02
Posts: 1912
Re: A Couple of things I have noticed [Re: Patrograd2]
      #2646938 - 06/02/04 03:00 AM

Thanks for taking the time to document these little quirks, Patrograd. They'll get cut'n'pasted into something handy so I'll have them around for the future.

...Klinn


Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
MentalElf
Adept

Reged: 01/25/04
Posts: 351
Loc: Hawaii, USA
Re: A Couple of things I have noticed [Re: Patrograd2]
      #2647289 - 06/02/04 05:06 AM

Yep OnDeath is sometimes missed, even without the potion
thing. I always use Gethealth <= 0 with a doOnce condition
to detect the dead... even if it missfires it will quickly fire
and solve the problem.

--------------------
I think, therefore I code!
MentalElf's Morrowind Page

Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Grumpy
Disciple

Reged: 08/03/02
Posts: 1363
Re: A Couple of things I have noticed [Re: MentalElf]
      #2648156 - 06/02/04 09:39 AM

Probably the same problem I've run into with trying to use == signs with SetPos or GetPos. I know that coordinates are carried out to three decimal places, and the game engine can bypass a set number using the == signs. Does not ascend or decend smoothly in other words, but jumps. Have always had to use a "range" to accomplish the task instead of a set number.

I know fatigue carries to at least a couple of decimal places, so health probably does too.

--------------------
Grumpy
My mods

Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Patrograd2
Curate

Reged: 02/02/04
Posts: 564
Loc: England
Re: A Couple of things I have noticed [Re: Grumpy]
      #2649579 - 06/02/04 05:21 PM

Quote:

Probably the same problem I've run into with trying to use == signs with SetPos or GetPos. I know that coordinates are carried out to three decimal places, and the game engine can bypass a set number using the == signs. Does not ascend or decend smoothly in other words, but jumps. Have always had to use a "range" to accomplish the task instead of a set number.

I know fatigue carries to at least a couple of decimal places, so health probably does too.




So do you think this should read:

if ( ONDeath >= 1 )
Journal etc
endif

??

--------------------
City of Thieves: In Development

Creator of DeathTrap Dungeon
Download Deathtrap Dungeon Version 1.3 here:
http://mwsource.com/center/pafiledb.php?action=file&id=1041


Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Grumpy
Disciple

Reged: 08/03/02
Posts: 1363
Re: A Couple of things I have noticed [Re: Patrograd2]
      #2652029 - 06/03/04 10:37 AM

Not really, cause I think "IfOndeath" is just boolean (1 or 0).

It's when you use something like a stat or distance check that you would want a spread. Anything that has decimal places in a possible return figure.

I meant this in relation to MentalElf's suggestion for using GetHealth because the return on that carries to two decimal places if I'm not mistaken.

Sorry for the confusion.

--------------------
Grumpy
My mods

Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Nigedo
Diviner

Reged: 05/30/03
Posts: 2040
Loc: Deep beneath Vvardenfell
Re: A Couple of things I have noticed [Re: Patrograd2]
      #2652097 - 06/03/04 11:01 AM

Thanks for those tips Patrograd.

On the subject of odd quirks, here's one I discovered while putting together Luthor's Compass.

When you use PlaceAtMe, you have no control over the initial facing position (z rotation) of the placed reference.

If you attempt to test the z rotation it may well return a negative value, e.g. -80 instead of 280. This is contrary to the assumption that all z rotation values should fall between 1 and 360 (or 0) degrees.

If you create an If.. Elseif structure based on the 'GetAngle z' value of the newly placed reference it will often behave erroneously because of the possible negative value.

e.g.

If ( reference->GetAngle z > 180 )
do something

Else
do something different

Endif

This will execute the second set of commands whenever GetAngle z returns a negative value, even though it's true value should fall between 180 and 360.

One way around this is to Rotate the reference for one frame, which appears to reset the value of its z rotation to a true positive value.

i.e.
If ( done == 0 )
reference->RotateWorld z 1
Set done to 1
Endif


--------------------
Dean of The Theoretical Whirling School Of Vivec

The Whirling School | Academy for Dwemer Studies | TES Lore FAQ

Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
MentalElf
Adept

Reged: 01/25/04
Posts: 351
Loc: Hawaii, USA
Re: A Couple of things I have noticed [Re: Nigedo]
      #2652986 - 06/03/04 05:33 PM

GetAngle, z :: returns +- 0 to 180 degrees, with 0 degrees
due North, positive angles East and negative angles West.

This deviation from 360 degree land is a Bethesda quirk.
It's also different from conventional trig in that in trig
0 degrees is due East.

Mapping from trig to Morrowind is a challenging problem
I've dealt with many times. Fun stuff!


--------------------
I think, therefore I code!
MentalElf's Morrowind Page

Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Pages: 1


Extra information
2 registered and 2 anonymous users are browsing this forum.

Moderator:  Umrahel, Freddo, Pete, klendathu, Lady Eternity, Locklear93, Hungry Donner, Archeopterix, slateman, tegger, Monica21 

Favorite Thread! (toggle)
Print Thread

Permissions
      You can start new topics
      You can reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 85

Rate this thread
 
Jump to

The Elder Scrolls Homepage

*
UBB.threads™ 6.3

Click for Privacy Statement 2003 Bethesda Softworks LLC, a ZeniMax Media company. All Rights Reserved.
PRIVACY POLICY | TERMS & CONDITIONS | LEGAL INFORMATION | CONTACT US