Quick Questions -- Quick Answers, The 21st

Post » Fri May 20, 2011 5:09 am

You can get a vague sense of where the ground is by dropping an object with a heavy collision (like a shield) that has its visual parts removed, checking its location after a second, recording its location, removing it, and placing the container there, but it doesn't always work well.
Better to use actors - They snap to the path grid in just a few frames. Or use player.getPos Z with isOnGround (as you can probably tell, this one isn't as accurate as it seems).
User avatar
Kira! :)))
 
Posts: 3496
Joined: Fri Mar 02, 2007 1:07 pm

Post » Fri May 20, 2011 4:57 am

Better to use actors - They snap to the path grid in just a few frames. Or use player.getPos Z with isOnGround (as you can probably tell, this one isn't as accurate as it seems).

While those are certainly true, not everyone wants their containers to be in a location that's in the center of the dang room/passage. Although using an item can be a bit more clumsy, it allows placing a container or an object on things that aren't where an actor would normally stand or move (like corners, on tables, ect). Although the second method described is a good alternative for those who are making use of OBSE, it still doesn't work well for spots that the floor is uneven, or is not part of the ground mesh (interiors, or other meshes (fort ruins, ships, rocks)). If you're going to go through the trouble of dynamically placing a container somewhere, you might as well try to use a system that allows placement in most of the spots that people would want a container to be placed. If you didn't care, you'd just be using "moveto player".
User avatar
Helen Quill
 
Posts: 3334
Joined: Fri Oct 13, 2006 1:12 pm

Post » Fri May 20, 2011 2:07 am

Can buttons in books be programmed ? Namely the take button ? Be made to add another book to the player's inventory ?
User avatar
XPidgex Jefferson
 
Posts: 3398
Joined: Fri Sep 08, 2006 4:39 pm

Post » Thu May 19, 2011 8:07 pm

You can probably check if the mouse is over the take button, intercept the click and run your script instead.

Maybe add a backup if anyone has a mod that allows them to click the button without using the mouse.
User avatar
Glu Glu
 
Posts: 3352
Joined: Sun Apr 01, 2007 5:39 am

Post » Thu May 19, 2011 6:47 pm

You can probably check if the mouse is over the take button, intercept the click and run your script instead.

Maybe add a backup if anyone has a mod that allows them to click the button without using the mouse.

Thanks - hmm a "dirty" solution :)
I have to be 100% sure - so probably I can't try this

Thanks anyway
User avatar
Beth Belcher
 
Posts: 3393
Joined: Tue Jun 13, 2006 1:39 pm

Post » Thu May 19, 2011 9:35 pm

Can buttons in books be programmed ? Namely the take button ? Be made to add another book to the player's inventory ?

Not exactly, but one solution might be to use a placed, no-pickup book that is scripted to place a temporary copy of the book nearby and then direct the activation of the book to that copy which can be picked up instead of the one which was placed. Something like:

begin onactivate playerif makeone == 0set bookref to tempmarker.placeatme  1set makeone to 1bookref.activateplayer 1elseif makeone == 1bookref.activateplayer 1endifendbegin gamemodeif player.getitemcount  >= 1 && makeone == 1set makeone to 0endifend


As long as the book being created with placeatme isn't scripted itself, there shouldn't be any problem.
User avatar
Robert Bindley
 
Posts: 3474
Joined: Fri Aug 03, 2007 5:31 pm

Post » Thu May 19, 2011 7:40 pm

Thanks - hmm a "dirty" solution :)
I have to be 100% sure - so probably I can't try this

Thanks anyway
Interrogate kyoma - He's got some experience with what you seek. Showler's idea will work, by the way.
User avatar
Sunnii Bebiieh
 
Posts: 3454
Joined: Wed Apr 11, 2007 7:57 pm

Post » Fri May 20, 2011 5:10 am

I know I just made a separate topic with this question, but how is the seteyes obse function supposed to be used in a script? I used Myref.seteyes eyeReanimate and it said it was an invalid inventory object for parameter body data. Did I get something wrong?
User avatar
Danny Warner
 
Posts: 3400
Joined: Fri Jun 01, 2007 3:26 am

Post » Fri May 20, 2011 12:34 am

I know I just made a separate topic with this question, but how is the seteyes obse function supposed to be used in a script? I used Myref.seteyes eyeReanimate and it said it was an invalid inventory object for parameter body data. Did I get something wrong?
Assign the eye record's editorID to a reference variable and use it instead.
User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Thu May 19, 2011 10:02 pm

Oh the body data type doesn't have a script variable? They should mention these things in the Wiki. Thanks for the advice, cheers ShadeMe :foodndrink:
User avatar
yessenia hermosillo
 
Posts: 3545
Joined: Sat Aug 18, 2007 1:31 pm

Post » Fri May 20, 2011 5:21 am

Oh the body data type doesn't have a script variable? They should mention these things in the Wiki. Thanks for the advice, cheers ShadeMe :foodndrink:
Most OBSE functions can't take an editorID as a parameter. You'll need to use a generic pointer instead (in this case, a ref var)
User avatar
Alexandra Ryan
 
Posts: 3438
Joined: Mon Jul 31, 2006 9:01 am

Post » Fri May 20, 2011 5:21 am

I'll remember that :) Good luck on the script editor extender, will be handy.
User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Fri May 20, 2011 5:50 am

A question about trigger zones - can they detect collision with a static object? For example, if a trigger zone is moving along, let's say, in front of an arrow, and the arrow is about to hit a rock (static), will the trigger zone register the rock?
User avatar
Fam Mughal
 
Posts: 3468
Joined: Sat May 26, 2007 3:18 am

Post » Fri May 20, 2011 6:18 am

Not exactly, but one solution might be to use a placed, no-pickup book that is scripted to place a temporary copy of the book nearby and then direct the activation of the book to that copy which can be picked up instead of the one which was placed. Something like:

begin onactivate playerif makeone == 0set bookref to tempmarker.placeatme  1set makeone to 1bookref.activateplayer 1elseif makeone == 1bookref.activateplayer 1endifendbegin gamemodeif player.getitemcount  >= 1 && makeone == 1set makeone to 0endifend


As long as the book being created with placeatme isn't scripted itself, there shouldn't be any problem.
Thanks for the script ! :) - the book will be scripted - I wanted to add a book A in the player's inventory which onEquip would check some conditions and activate one of two similar books (B and C) accordingly. But if the player dropped book A and activated it he would see a take button but it would belong to the B or C not to A. So I wanted to program B and C's take to add A to the inventory. I will see if I can modify your solution to my needs. Thanks again :tops:


Interrogate kyoma - He's got some experience with what you seek. Showler's idea will work, by the way.
Thanks :)
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am

Post » Thu May 19, 2011 9:52 pm

Ok I'm making a small mod that let's you access every spell effect when making spells or enchanting something. The way I'm doing it is to give the player dummy spells, one for each spell effect, and then remove them when the player is done. It works perfect for spell making, every spell effect is available. But it's not working at all in the enchantment menu, even though I'm using the exact same methodology. Is there any difference in the way things are handled in the enchanting menu?

Here's the script. It's pretty straight forward, I edited out the 110 dummy spells to save space :P. The "activate" variable is set in a dialogue option.

scn aaCKESControlScriptshort doonceshort methimshort activateBegin gamemodeif (doonce == 0)	addtopic aaCKESEnchant	addtopic aaCKESSpell	set doonce to 1endifif (activate == 1)player.addspellns ckESS1ALL OTHER DUMMY SPELLSshowenchantmentendifif (activate == 2)player.addspellns ckESS1ALL OTHER DUMMY SPELLSshowspellmakingendifif (activate == 2 || activate == 1)	set activate to 3endifif (activate == 3)player.removespellns ckESS1ALL OTHER DUMMY SPELLSset activate to 0endifEnd

User avatar
Andrew Tarango
 
Posts: 3454
Joined: Wed Oct 17, 2007 10:07 am

Post » Thu May 19, 2011 8:41 pm

Probably a dumb question, but is there a way to make an attacking npc to be "unyielding" by any means?. I use the startcombat player sentence in a script so certain npc attacks me, but if i ask him to yield he does, and i would like him to fight till he dies, no matter what. It this possible?
User avatar
Kelly John
 
Posts: 3413
Joined: Tue Jun 13, 2006 6:40 am

Post » Thu May 19, 2011 5:55 pm

Probably a dumb question, but is there a way to make an attacking npc to be "unyielding" by any means?. I use the startcombat player sentence in a script so certain npc attacks me, but if i ask him to yield he does, and i would like him to fight till he dies, no matter what. It this possible?

Yep, controlled by their combat style.
http://cs.elderscrolls.com/constwiki/index.php/Combat_Style
User avatar
Jacob Phillips
 
Posts: 3430
Joined: Tue Aug 14, 2007 9:46 am

Post » Fri May 20, 2011 5:42 am

Yep, controlled by their combat style.
http://cs.elderscrolls.com/constwiki/index.php/Combat_Style

Thanks, that worked out. One more thing: how can i activate a script after consuming a potion? I mean i have a potion in my inventory and when i consume it i wanna trigger a script, i tried both onequip or onactivate and they don't work (i mean the onactivate works if the potion is on the ground, but the idea is that it works when i consume it)

Thanks
User avatar
KiiSsez jdgaf Benzler
 
Posts: 3546
Joined: Fri Mar 16, 2007 7:10 am

Post » Fri May 20, 2011 6:31 am

Is there any limit to the size of an array? I'm experimenting a bit with putting lots of stuff into an array, but somehow I never manage to get more than 1036 elements into one array.
User avatar
Leticia Hernandez
 
Posts: 3426
Joined: Tue Oct 23, 2007 9:46 am

Post » Thu May 19, 2011 7:50 pm

Thanks, that worked out. One more thing: how can i activate a script after consuming a potion? I mean i have a potion in my inventory and when i consume it i wanna trigger a script, i tried both onequip or onactivate and they don't work (i mean the onactivate works if the potion is on the ground, but the idea is that it works when i consume it)

Thanks

Add a script effect to the potion ?

if not (but why not in this case ?) you need to make a quest script counting the number of potions in player's inventory http://cs.elderscrolls.com/constwiki/index.php/Adding_a_script_to_an_ingredient
User avatar
Thema
 
Posts: 3461
Joined: Thu Sep 21, 2006 2:36 am

Post » Thu May 19, 2011 10:08 pm

Is there any limit to the size of an array? I'm experimenting a bit with putting lots of stuff into an array, but somehow I never manage to get more than 1036 elements into one array.

Whoops! My bad!

I forgot to reset a variable somewhere in my code causing the while loop to finish after 1036 elements. The actual size of the array is 3301 elements. :P
User avatar
Zosia Cetnar
 
Posts: 3476
Joined: Thu Aug 03, 2006 6:35 am

Post » Thu May 19, 2011 8:15 pm

Add a script effect to the potion ?

if not (but why not in this case ?) you need to make a quest script counting the number of potions in player's inventory http://cs.elderscrolls.com/constwiki/index.php/Adding_a_script_to_an_ingredient


Yeah, i added a script effect to the potion but i cant pull it off. My idea is that this scripts checks if the player is a vamp, if it is it restores 10 health, if not it damages 10 health.

So far i tried something like this:
scn VSMHumanBloodScriptshort dooncebegin menumode 1002if pcvampire == 0 && doonce == 0set doonce to 1messagebox "You're not a vampire!"endifendbegin scripteffectstartif doonce == 1cast StandardDamageHealthTouch3Journeyman playerset doonce to 0endifend


This is an idea, simply it check if pc is a vamp, if not it damages the health of the player. The first part of the code works, when in my ingredient's inventory and i use the potion it displays the message, but i cant get the effect to work. Tried "Gamemode" instead of scripteffectstart and nothing.

Any ideas? Thanks :)
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Thu May 19, 2011 9:58 pm

Yeah, i added a script effect to the potion but i cant pull it off. My idea is that this scripts checks if the player is a vamp, if it is it restores 10 health, if not it damages 10 health.

So far i tried something like this:
scn VSMHumanBloodScriptshort dooncebegin menumode 1002if pcvampire == 0 && doonce == 0set doonce to 1messagebox "You're not a vampire!"endifendbegin scripteffectstartif doonce == 1cast StandardDamageHealthTouch3Journeyman playerset doonce to 0endifend


This is an idea, simply it check if pc is a vamp, if not it damages the health of the player. The first part of the code works, when in my ingredient's inventory and i use the potion it displays the message, but i cant get the effect to work. Tried "Gamemode" instead of scripteffectstart and nothing.

Any ideas? Thanks :)
I guess you made a magic effect script and put it in the potion's results. This :
scn VSMHumanBloodScriptshort dooncebegin scripteffectstartif pcvampire == 0 && doonce == 0set doonce to 1message "You're not a vampire!"endifif doonce == 1cast StandardDamageHealthTouch3Journeyman playerset doonce to 0endifend
works ? I am not sure about cast also, never used it.
User avatar
Ross
 
Posts: 3384
Joined: Thu Aug 10, 2006 7:22 pm

Post » Fri May 20, 2011 2:47 am

Is there any limit to the size of an array? I'm experimenting a bit with putting lots of stuff into an array, but somehow I never manage to get more than 1036 elements into one array.
Pragmatically, nothing. On x86 (32-bit) machines, it should be the maximum size of a std::map, which is around 0x1FFFFFFF.
User avatar
Chloe Botham
 
Posts: 3537
Joined: Wed Aug 30, 2006 12:11 am

Post » Fri May 20, 2011 1:51 am

I guess you made a magic effect script and put it in the potion's results. This :
scn VSMHumanBloodScriptshort dooncebegin scripteffectstartif pcvampire == 0 && doonce == 0set doonce to 1message "You're not a vampire!"endifif doonce == 1cast StandardDamageHealthTouch3Journeyman playerset doonce to 0endifend
works ? I am not sure about cast also, never used it.


Unfortunately it doesnt, it displays the message at the top but the effect is never triggered. As a matter of fact if i use
begin onactivateif pcvampire == 0 && doonce == 0set doonce to 1messagebox "You're not a vampire!"endifendbegin gamemodeif doonce == 1cast StandardDamageHealthTouch3Journeyman playerset doonce to 0endifend


it does works when i try to pick the potion up, but the idea its that the effect is triggered when i drink it, which it doesnt :(
User avatar
des lynam
 
Posts: 3444
Joined: Thu Jul 19, 2007 4:07 pm

PreviousNext

Return to IV - Oblivion