Small problems to solve - to small to see solution^^

Post » Thu Dec 08, 2011 10:27 am

Well, I have small problems in Scripting. The Scripts seem to be easy for me, but they don't work as expected.
I tried a lot already, but I think, I am too blind to see, whereof the problems result.

EDIT: The first problem is solved.

EDIT: The second probem is solved - this one drove me nearly mad ...

EDIT: Third problem is solved, too. With a fine script my creature is doing, what i wanted it to do ;).

EDIT: A fourth problem is occured. Look below.

EDIT: Further problems to be solved: look below.
User avatar
Avril Louise
 
Posts: 3408
Joined: Thu Jun 15, 2006 10:37 pm

Post » Thu Dec 08, 2011 12:43 am

Well, I have small problems in Scripting. The Scripts seem to be easy for me, but they don't work as expected.
I tried a lot already, but I think, I am too blind to see, whereof the problems result.

The first script is expected to work on a button / lever. The button / lever has a wrong wall as a parent.
This wall should disappear to give way to a passage and appear to block it again, when the
button is pressed. It's a secret door. Actually it lets the wall disappear, but the button disappears itself,
too, so the passage can't be blocked again.

From the CS wiki
Enable - Does not work on objects with a parent ref. You will have to use the function on the parent ref instead. Use GetParentRef to find the parent ref. There is currently no function to determine the "Enable State to Opposite of Parent" flag.

User avatar
James Wilson
 
Posts: 3457
Joined: Mon Nov 12, 2007 12:51 pm

Post » Wed Dec 07, 2011 9:25 pm

From the CS wiki



Well, that's not the full truth ... the problem was, that it worked on parent and the child.
Everything has been disabled, what was as parent linked together.
But I solved the problem in another way, but thx. :wavey:
User avatar
Catherine N
 
Posts: 3407
Joined: Sat Jan 27, 2007 9:58 pm

Post » Thu Dec 08, 2011 1:01 am

Your second issue stems from this not being the way messageboxes work. 1) Once they're open, the game's in MenuMode. And 2) GetButtonPressed does not wait for a button to get pressed, so in your script it will only check once, a millisecond or less after opening the messagebox dialog, then never again.
The usual way to go about it would be by setting a variable telling the box was opened and in a MenuMode block repeatedly checking for the button presses as long as this variable is set.
The second messagebox would usually set this state variable to another value, so you could check for another set of button presses and act accordingly, but this is not neccessary here, as there's no option in the second box. The game will simply go on (return to GameMode) as soon as the box is closed.

The timer doesn't work that way either. There's no branching in the condition, so the script will just get past the check no matter if timer is < 10 or not.
If the timer is meant to return control, it should take place in a GameMode block rather, inside a condition telling the second messagebox was opened already.

I'd restructure your script following way:
scn AMTotenGedenkenshort buttonfloat timershort stepBegin OnActivate    set step to 1    MessageBox "M?chtest Du einen Augenblick innehalten und dem Sch?pfer der Halle sowie Deiner eigenen Sterblichkeit gedenken ?", "Ja", "Nein" ; Yes or NoEndBegin MenuMode    if(step == 1)        set button to getButtonPressed        if ( button == 0 )            set step to 2            DisablePlayerControls            MessageBox "Du versinkst für 10 Sekunden in stillem Gedenken.", "OK"        endif    endifEndBegin GameMode    if(step == 2)        playsound AMBVoicesInHeadLP        set timer to 0        set step to 3 ; short 1-frame initialization phase + I do not know if PlaySound would work in MenuMode    elseif(step == 3)        if ( timer < 10 )            set timer to timer + getSecondsPassed            return ; so execution breaks here and does not reach EnablePlayerControls before the timer runs up        endif        EnablePlayerControls        set step to 0 ; do not enter here again from now on, unless starting over    endifEnd

The script should even be repeatable designed this way.

Ich hoffe das hilft.
User avatar
Curveballs On Phoenix
 
Posts: 3365
Joined: Sun Jul 01, 2007 4:43 am

Post » Thu Dec 08, 2011 10:52 am

Thx for this answer, well, it opened my eyes for some things about scripting.
I lerned to handle scripting blocks (esp. menumode) much better and
your handling of the timer helped me in two scripts^^.

Well, let's see, where this is leading to ;)



P.S.: hehe, it's a bad thing, when secret passages are closed seconds after passing -
where the heck is the exit ? - this works already ... don't trust in loosely levers ...^^
User avatar
Captian Caveman
 
Posts: 3410
Joined: Thu Sep 20, 2007 5:36 am

Post » Thu Dec 08, 2011 4:43 am

Oh, one more thing. I think I forgot about the second answer, to get out of the "step == 1" situation with the repeated checks for buttonpresses.
Begin MenuMode    if(step == 1)        set button to getButtonPressed        if ( button == 0 )            set step to 2            DisablePlayerControls            MessageBox "Du versinkst für 10 Sekunden in stillem Gedenken.", "OK"        elseif ( button == 1 )            set step to 0 ; stop checking for buttonpresses when answer was no        endif    endifEnd

That's better. :sweat:
User avatar
Darren
 
Posts: 3354
Joined: Wed Jun 06, 2007 2:33 pm

Post » Thu Dec 08, 2011 8:53 am

Okay, the second problem is solved, too, now. The new script works as suggested.
This problem drove me nearly mad ... the script looks quite different
from yours, Drake, but your work was of great help although.

New tasks, which remain are to put more plants in the garden of my noble hall,
to implement a markerrat to be sure, my teleporting works well all times and
to exlaborate a smal bonus quest around it, which brings a new dealer in the
game with enough money for higher levels.

Then my mod will be completed.
User avatar
x_JeNnY_x
 
Posts: 3493
Joined: Wed Jul 05, 2006 3:52 pm

Post » Thu Dec 08, 2011 6:52 am

4. problem

Darn, a new idea and a new small problem. - I want to establish a small zone in my cell, where it is impossible to cast (esp. a teleport-spell).
The player shouldn't be able to teleport himself out there, but search for a button to open a secret door.

So I placed a trigger-zone at that place and made a small script
scn ...

Begin OnTriggerActor
modActorValue Silence 1 ; ( ... or 100)
End

And did the same at the exit of this zone to put Silence to 0 again.

But I see no effect at all ...

Why couldn't it be so easy ?^^

5. problem

Wanted to modify a SE...nif, but tes4bsa stops unpacking the se-file with an error.
On the other hand the addon works fine ...
User avatar
Catharine Krupinski
 
Posts: 3377
Joined: Sun Aug 12, 2007 3:39 pm

Post » Wed Dec 07, 2011 8:17 pm

4. problem

Darn, a new idea and a new small problem. - I want to establish a small zone in my cell, where it is impossible to cast (esp. a teleport-spell).
The player shouldn't be able to teleport himself out there, but search for a button to open a secret door.

So I placed a trigger-zone at that place and made a small script

And did the same at the exit of this zone to put Silence to 0 again.

But I see no effect at all ...

Why couldn't it be so easy ?^^


I think this is because the script doesn't know the triggering actor. The default reference is the triggered object the script is running on itself. Modifying the silence of this one won't do anything.

You could cover this by using "GetActionRef" to determine the triggering actor, or if it is to be only reacting to the player anyways, just make it "OnTriggerActor player" and use "player.modActorValue ..." to modify.

I don't know about the 5th one, but perhaps try OBMM's BSA Browser from the Utilities menu? This one at least hasn't failed me, yet.

edit: If modifying Silence itself doesn't do the trick, you could still let something (maybe even the player) "cast" silence onto the player. Using ".cast " has neither triggered a casting animation so far nor required the spell to be learned by the caster. But you might need an unlimited silence spell for this first, or regularly refresh it... something along that line.
User avatar
Jimmie Allen
 
Posts: 3358
Joined: Sun Oct 14, 2007 6:39 am

Post » Thu Dec 08, 2011 9:02 am

Oh, I am such an idiot ... I tried everything and took ForceValueActor at last ... and in the evening I recognized suddenly,
that I completly unnecessarily set my teleportspell to be immune to being silenced ... ^^

Problem 4 is solved. The Problem was selfmade.

About problem 5: I'll have a look on this program, thx.

EDIT: Ah, that's a fine one and much more comfortable than the old dos-based i used. Thx for this, too.

Problem 5 is solved, too.

Let's see, what comes up next ... ^^
User avatar
chirsty aggas
 
Posts: 3396
Joined: Wed Oct 04, 2006 9:23 am

Post » Thu Dec 08, 2011 12:05 am

Problem 7:
Hm, annoying behavior of NPC ... much too often they break off their patrol and run to the pc and try to reach ps's
location. Is there any way to avoid this ? - She only got patrol-point KI-packages. Don't know where this behavior
results from. Who can say her: "Grandma, slow down a little bit ?"^^^.

EDIT: Okay, this problem is solved either: I understood this "Continue if PC near" exactly opposite to
its meaning here. Unchecking this box fixed the problem.


Problem 8:
Next problem: I won't get a true with the "getCell"-Function as a quest-stage-condition.

EDIT: Problem 8 is solved. A syntax-problem, which wasn't recognized by the compiler.
User avatar
Alexxxxxx
 
Posts: 3417
Joined: Mon Jul 31, 2006 10:55 am

Post » Thu Dec 08, 2011 5:06 am

Problem 9:
I made an npc dealer. He deals with items, offers training, recharches magic items and deals with spells. It was no problem so far, he owns a merchant chest and so on. He is in the mages guild and is able to cast himself. He has his spells for this.
But i don't have a clue, how to add spells for selling. I can't add spells to the merchants chest and the window for dealing spells ingame is empty. There're no spells offered.
User avatar
Emily Rose
 
Posts: 3482
Joined: Sat Feb 17, 2007 5:56 pm

Post » Thu Dec 08, 2011 7:28 am

Problem 10:
My selfmade NPC don't offers his Topics. - I tried everything and read the tutorials of the wiki up and down.
I tried to "addtopic" them in the first stage (start enabled quest), tried unconditioned in the questscript,
tried to add vie queststages result script ... stages are done and still no new topic ... all topics are to
see in the dialogue-window of the char and in t he quest window. I really don't know, what to try next ...
So far I get only Services and Rumor.
User avatar
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Thu Dec 08, 2011 2:45 am

Problem 9 + 10 are still unsolved.

To Problem 10 I can say, that I tried to add an own GREETING now, in trying to force the other topics of the quest,
but still the npc only uses the generic greetings (of course without using the 'addtopic-box', because i read about
this bug around it). Every Topic has condition getisID. Some have additional ones. The whole quest (and dialog) is
nearly written, but all this is useless, when i am not able, to start the quest topics at all ...
In the dialog-window only appear the rumors and the services. i once gave the greetings the name greetings and
then this appeared there, too, but i could only get through all generic greetings with it, never showed up the
selfmade one ... weird - seems cs don't likes me ...
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Thu Dec 08, 2011 12:08 am

About problem 10 ...

even unconditioned nowhere appears only one of my topics. Additionally I recognized, that a faction icon i
made isn't in place. It shows up, like the topics, too, only in tescs. That's leading me to the question, well,
perhaps tescs saves topics and icon somewhere, where it knows, but the game won't ...
may this be possible ? - and how could i fix this ?

I am completely stuck - but nearly ready - pls help ...

EDIT: Made a TestQuest, TestChar and TestDialogue - and there we go - this simple thing works at first try ...
bah, where may the problem result from ...

EDIT: Well, after all it seems I succeed after all in debugging. It's really weird: i am sure the quest started:
i had an entry in the quest-log and other scripted things happened. But it seems nevertheless that a
condition for starting the quest used to be the point, why the dialogue won't work ...

EDIT: Okay, problem 10 is solved, too, now.

Open problems for now: Problem 9 (look above) and the missing icon i call problem 11 now.


Problem 11: I made a faction icon, which is visible in the tescs faction menu, but isn't appearing in
the game. There the faction-membership is shown, but the place for the icon is vacant. The dds-file
is saved in the texture-folder. ...

EDIT: okay, i looked after the other faction-icons. It seem to be a set of three pictures of different measures.
I put my icon in the same measures, but the size still seems to be too big. My pictures aren't comprimized
dds, but the originals seem to be. Does anybody know, which method they have used ?

EDIT: okay, altogether:
path: \texture\menus\stats\misc_faction_icons\my_icon.dds shrunked with DXT5 (should be the right one).
The other two files are in ...\menus50\... and ...\menus80\...
But still the icon is only to see in tescs menu, not in the game, where the factions are shown.
My Faction is there, but without my icon ...
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Thu Dec 08, 2011 11:18 am

Problem 12: Cellreset isn't working.

The idea is to reset my own cell just through leaving it and resting for about an hour as a trigger.
But the condition never seems to become true.

scn (OwnQuestScript)

Begin GameMode

( ...)

if ( player.getInCell OwnCellID != 1 ) && ( player.IsWaiting == 1 )
resetInterior AsylumMeumZelle
endif

User avatar
Ana Torrecilla Cabeza
 
Posts: 3427
Joined: Wed Jun 28, 2006 6:15 pm

Post » Wed Dec 07, 2011 8:20 pm

Problem 9:
I made an npc dealer. He deals with items, offers training, recharches magic items and deals with spells. It was no problem so far, he owns a merchant chest and so on. He is in the mages guild and is able to cast himself. He has his spells for this.
But i don't have a clue, how to add spells for selling. I can't add spells to the merchants chest and the window for dealing spells ingame is empty. There're no spells offered.

Your NPC has to be ABLE to cast the spells. Check if your spell you want to sell is ranked master ot some other rank that is higher that your npcs ability to cast spells form that school. Check the cost too.
And if nothing works... make a quest with a quest script that adds the spell to your npc .. after that stop the quest in its own quest script so the quest won't load again.
User avatar
james tait
 
Posts: 3385
Joined: Fri Jun 22, 2007 6:26 pm

Post » Wed Dec 07, 2011 7:48 pm

Problem 10:
My selfmade NPC don't offers his Topics. - I tried everything and read the tutorials of the wiki up and down.
I tried to "addtopic" them in the first stage (start enabled quest), tried unconditioned in the questscript,
tried to add vie queststages result script ... stages are done and still no new topic ... all topics are to
see in the dialogue-window of the char and in t he quest window. I really don't know, what to try next ...
So far I get only Services and Rumor.

Just add the topics with a quest script in the quest. Then check the conditions of your topics if the're TRUE so the topics can be seen at all.-- oh .. solved
User avatar
Beulah Bell
 
Posts: 3372
Joined: Thu Nov 23, 2006 7:08 pm

Post » Thu Dec 08, 2011 10:22 am

Problem 11..
had same problem. Had to write the faction icon path in archiveinvalidation.txt
User avatar
JR Cash
 
Posts: 3441
Joined: Tue Oct 02, 2007 12:59 pm

Post » Wed Dec 07, 2011 10:15 pm

Your NPC has to be ABLE to cast the spells. Check if your spell you want to sell is ranked master ot some other rank that is higher that your npcs ability to cast spells form that school. Check the cost too.
And if nothing works... make a quest with a quest script that adds the spell to your npc .. after that stop the quest in its own quest script so the quest won't load again.

Oh, well, she is able to cast, but i made her a master. Thought she wuold sell it simply ... although, why shouldn't a master
sell spells at much lower level, too. *fg* Okay, it's intended to be of use later in the game (perhaps lvl 35+ or more) and i
would say then: it's solved, too, because it's no problem. - Problem 09 is fixed.

Problem 11 still unsolved:
Problem 11..
had same problem. Had to write the faction icon path in archiveinvalidation.txt

?hm, okay ... how does this works and what's all about this txt-file ?

Problems 12 and 13 to go:
And after it problem 12 remains with low priority. The last problem (let's call it no. 13) then seems to be the implementation
of a marker creature. I made so far a teleport-spell with a fix x-marker-heading in my cell and always set a x-marker-heading
to the position, where i cast it, when i am not in my cell. - The problem as i understood it, is, that the 'moving' marker
tends to jump back to it's original position. To do something against it, one should progam a 'marker-rat'. I looked
about it, but it looks so complicated and i don't understand wether the existing scripts nore why it has to be so
complicated. Why not simply put the crature next to the marker when it is set and before player moves back to it simply
check if the marker is still next to the creature or move it back there ... ? Sounds simple enough or not ?^^ - Well,
could anybody tell me more about it ?

That then should be all and the mod ready for open-beta^^.

Thanks to Deylendor so far.
User avatar
Hannah Whitlock
 
Posts: 3485
Joined: Sat Oct 07, 2006 12:21 am

Post » Thu Dec 08, 2011 12:53 am

Hah. Teleport spells are my speciality.

Just tell me exactly how your teleport spell should operate.

My favorite type of teleport spell operate like this:
cast->MyXMarkerRefAA.MoveTo player->player.MovveTo MyXmarkerRefBB
when in cell that has the MyXMarkerRefBB offer a messagebox to player "Do you want to return where you used your teleport spell to return here last?" ( or something like that) -> YES -> Player.MoveTo MyXmarkerRefAA

MyXMarkerRefAA & MyXMarkerRefBB are actually refs from the XMarker in the CS
User avatar
evelina c
 
Posts: 3377
Joined: Tue Dec 19, 2006 4:28 pm

Post » Thu Dec 08, 2011 9:16 am

Well, so far my teleport works well as it is, but i read so much about this problem, that a moved
marker is in danger to be reset to its starting position. To prevent this to happen a marker rat
should be made. This is pure theory for me right now.
I made a quest to give the spell to the player and the spell script is simply enough:
Begin ScriptEffectStart

if ( player.getinCell MyCell == 1 )
Player.MoveToMarker X-Marker-Heading-ID
else
if ( player.IsInCombat == 1 ) || ( player.IsTrespassing == 1 ) || ( player.getincell DreamHub == 1 ) || ( player.getincell DreamofCourage == 1 ) || ( player.getincell DreamofPatience == 1 ) || ( player.getincell DreamofPerception == 1 )
MessageBox "Ich kann mich jetzt gerade nicht auf den Spruch konzentrieren." "OK" ; simply translated: "not this time"
else
X-Marker-Heading-ID.MoveTo Player
Player.MoveToMarkerX-Marker-Heading-ID-fix-in-my-Cell
endif
endif

End

Perhaps it's fine right in this way. I don't think players will be there more than two/three days in a row ... using bed, using
chests and finally harvesting the garden ... and searching for the hidden secrets won't last days ... (perhaps for the player
in real time, but not ingame^^ *fg*) - I think, that's like your suggestion.


Ah, what is about this txt-file you mentioned earlier ?
User avatar
Taylor Bakos
 
Posts: 3408
Joined: Mon Jan 15, 2007 12:05 am

Post » Thu Dec 08, 2011 8:47 am

Don't worry about the "reset" problem.. well, it actually isn't a "reset". If you cast your teleport spell lets say .. somewhere in tamriel to teleport to your cell.. the B marker goes to you and you go to A marker. If you cast your teleport spell in the cell with the A maker you get teleported to the B maker posotion.. NOW .. you fear for the B marker to reset. Could happed if you weren't at the B marker position for 3 days ( or less if you used bash to change this. I have this set to 1 and many have for better "crap" cleanup like bodies etc ). But DOESN''T happed if your B marker is actual an reference of and actual PERSISTEN INVISIBLE(HIDDEN/DISABLED AT START) CREATURE. So instead of using references of XMarkers just use 1 reference ( your moving one, that would be B ) that is reference of a creature that is tagged hidden and persistent.

Your code won't change... just replace your moving destination with a creature REFERENCE. Just make a new rat wirh new id, tag it disabled, drag it to your starting marker cell ( can be the same as the teleport target cell ), edit the dropped creature to be a persistent reference and give it a REF id. Now just write in the code to move THIS creature ref to your position before tekeporting, and to teleport back to it when teleporting back.
The problem happens because the game doesn't expect statics to change gameworlds.. but it expects that for creatures. You markers aren't actually reset, they regain their coordinates but reset their original gameworld.

Begin ScriptEffectStart

if player.getinCell MyCell;; if you compared if its equal to 1, don't need the (=1) at all.
Player.MoveTo CreatureMarker-Heading-REFID;;use MoveTo and use a persistent creature reffrerence to return to here( can be disabled at start )
else
if player.IsInCombat || player.IsTrespassing || player.getincell DreamHub || player.getincell DreamofCourage || player.getincell DreamofPatience || player.getincell DreamofPerception
MessageBox "Ich kann mich jetzt gerade nicht auf den Spruch konzentrieren." "OK" ;;Ja Deutsch is geil ;)
else
CreatureMarker-Heading-REFID.MoveTo Player
Player.MoveTo MarkerX-Marker-Heading-ID-fix-in-my-Cell
endif
endif

End
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Thu Dec 08, 2011 10:19 am

Well, that IS that easy I thought it should be - I really don't know what a tohuwabohu some writers make about it.
Everywhere it looked so complicated, much scripting, additional quest, global variables ... whooo
- I never understood those ones. - This is easypeasy.

Okay, problem 13 is solved, too.
User avatar
Holli Dillon
 
Posts: 3397
Joined: Wed Jun 21, 2006 4:54 am

Post » Thu Dec 08, 2011 12:13 pm

Summary
Problem 11: I made a faction icon, which is visible in the tescs faction menu, but isn't
appearing in the game. There the faction-membership is shown, but the place for the icon is vacant. The dds-file
is saved in the texture-folder: path: \texture\menus\stats\misc_faction_icons\my_icon.dds shrunked with DXT5

I will add a quest-icon, too. Maybe it'll have the same problem.
EDIT: No, to get the quest-icon was no problem. This works.
EDIT: Problem 11 is solved at last. dds with DXT5 was right. Only simple problem was, that the "Menu"-folder had to be
written with a capital "M". Oh man, a problem little enough^^.

Problem 12: Cellreset isn't working.

The idea is to reset my own cell just through leaving it and resting for about an hour as a trigger.

EDIT: Problem 12 is solved. I solved it in a different way: i use a
'self new adding magical enchanted script effect scroll'. Wuff^^.

Problem 14: My topics are too quick.
EDIT: Problem 14 is solved. I created silent voice files with tes4gecko 15.2.
User avatar
Matt Gammond
 
Posts: 3410
Joined: Mon Jul 02, 2007 2:38 pm

Next

Return to IV - Oblivion