Jump to content

Why won't this script work?


Kobeshimi

Recommended Posts

not sure where to post this, pardon if this isn't a proper branch

 

so i've written this, but it doesn't seem to have any effect on target npc.. any ideas why? where did i screw up?

 

 

??? blablaSCRIPT

 

begin onload

 

if getincellpar megatonplayerhouse playerbed ==1

if getitemcount outfitmerc06 =1

removeitem outfitmerc06 1

else getitemcount outfitmerc06 =0

getincellpar megatonplayerhouse playerbed ==0

additem outfitmerc06 1

endif

endif

endif

end

 

 

??

thanks in advanse for any tips, to whoever knows this stuff (ive also tryed with extra lines like "getiepackege sleep",or something like it, with same effect, which is no effect what so ever)

Link to comment
Share on other sites

When posting scripts, please use "code" tags and indent your scripts, otherwise they are very difficult to read. If you don't know how to indent scripts, here is a page that you can use to do it for you - Script Indenter

 

The first thing you'll notice when using that indenter is that you have one too many "endif" statement. Keep in mind that you need one "endif" for each "if" statement, "elseif" and "else" statements don't need "endif" statements of their own.

 

When you try to compile this script, you'll first find that it's missing a "ScriptName" declaration. You need to replace your "???" with "ScriptName". After that, you'll realise that "GetInCellPar" is not a valid function. The function that you're looking for is GetInCell.

 

When comparing two values, you need to use "==", as opposed to "=". For example, "if GetItemCount outfitmerc06 == 1".

 

As Callighan said, OnLoad probably isn't the blocktype that you want to use. Before I can tell you what blocktype to use, I'll need to know what you want this script to do, as there currently isn't really an indication.

 

So, what is this script supposed to do?

 

Cipscis

Link to comment
Share on other sites

wow, you guys r fast! thanks alot! i'm loaging geck now..

 

basically, i can only judge if scripts r ok by hitting save, and it tells me what line is screwed up..

 

the script intention is to make lucy west sleep in playersbed undressed when family ties are complete. that is on a long scale. right now i'm stuck with this part. I could've done it simplier, with " get to bed when player get in cell", but i'd rather keep normal sendbox behaviour with element of chance.

Link to comment
Share on other sites

scn LucyWestSCRIPT

begin gamemode
if LucyWest.getincellparam megatonplayerhouse playersbed ==1
  removeitem outfitmerc06 1
else LucyWest.getitemcount outfitmerc06 < 1 
 additem outfitmerc06 1
endif
end

 

i've also tryed this, thinging shorter it is, less chance i'd screwup

Link to comment
Share on other sites

In that case, you'll want to use a token (an unplayable, therefore invisible, piece of armour) that takes up all appropriate biped slots to force her to unequip her clothing. You'll want the script to run when she goes to bed, so the easiest way to do this would probably be to use a scripted triggerbox (see Creating Primitives) around her bed. The triggerbox would have a script like this attached:

ScriptName GenericUndressScript

ref rTriggerRef

Begin OnTriggerEnter

set rTriggerRef to GetActionRef
if rTriggerRef.GetCurrentAIProcedure == 8 ; SLEEP
	rTriggerRef.AddItem UnequipToken 1 1
	rTriggerRef.EquipItem UnequipToken 0 1
endif

End

Begin OnTriggerLeave

set rTriggerRef to GetActionRef
if rTriggerRef.GetItemCount UnequipToken
	rTriggerRef.EquipItem UnequipToken 0 1
	rTriggerRef.RemoveItem UnequipToken 1 1
endif

End

This script uses the "EquipItem/RemoveItem hack" to force the Actor to re-evaluate what they have equipped when they leave the triggerbox. The hack is documented on the GECK Wiki here - Force an actor to equip new stuff

 

Cipscis

Link to comment
Share on other sites

Thank you, man, i'll try playing with trigger/token

(i didn't thik of general unavailability of armor removing, cause i also use "companion trade mod" in game, that automatically lets removing the only piece of armor)

 

 

although, it does look far more complicated, i have now idea hou to program that token thing, and i wasn't gonna make separate quest out of it, instead just adding "if quest #familyties is done, than add to faction=>" line to lucies script

Link to comment
Share on other sites

If you place a triggerbox with that script around her bed, and add a condition to check GetQuestCompleted and GetIsReference, then it would work only on her and only after the relevant Quest is completed.

 

The token doesn't need to be scripted, it just needs to take up all of the Biped Slots that you want to be unequipped. It is the triggerbox that will have the script attached to it.

 

Cipscis

Link to comment
Share on other sites

and for getisreference should i use full hex value or a name with "if", or it's assumed ?

 

nice, this way no need fo new faction either..

 

 

lol

 

i don't even know anymore :) made a trigger, the bed just disappered from the room (visually, i still can sleep in t) :)) even if i assign a gastrap, or no script at all, same thing :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...