Jump to content

Push Button Scripting Animation


kingtitan

Recommended Posts

I am working on a mod in which I have a "teleport to marker system." Basically, the player activates a push block to set the marker, and then can cast a certain spell to transport a NPC to the marker. The actually functionality of the marker and spell system works fine, but the animation is not scripted into the push block upon activation! I honestly have no idea how to do it as I am no scripter (a friend of mine wrote these two scripts for me as is). I gave it a shot myself using the "ARSwitch01" vanilla script but it keeps saying 'busy' is an unknown variable. If someone could take a look at it for me I would be very grateful!
Link to comment
Share on other sites

First off, Fore, I'm honored; I use both NoMaam animation mods of yours. Only animations that are even close to reality and that don't make male's walk very girly, to say the least.

 

That aside, is there anyway you would be willing to take a look at the script in the .esp? I already even have it uploaded! And I literally have no scripting experience (unfortunately) but I'm sure someone like you would be able to fix it rather quickly and effortlessly!!

Link to comment
Share on other sites

I'm glad you like NoMaaM. And I'm happy about every endorsement, IF I can get it. ;)

 

When I needed a switch or a door, I have more or less copied vanilla stuff. But I sure can have a look. What's the mod/upload and the name of the script?

Link to comment
Share on other sites

And that's what was confusing me, that's exactly what I was trying! But seeing as you have quite a bit more scripting experience and knowledge than me, I'm sure you will find better success!

 

.Esp is found here.

When you load it in the CS, it may say there are some "errors," but those are just because I duplicated a cell that I haven't entirely cleaned of past references, ect. Won't pose any problems as far as the script.

 

The script name is ATPrisonSwitchScript01 (to the best of my knowledge, if that isn't the exact name it is very very close).

 

Let me know if you need any extra information!

 

P.S. I actually just got around to getting the NoMaam breathing idle omod last night, so thanks for the reminder. Gladly endorsed :D

Link to comment
Share on other sites

kingtitan, first of all, are you aware that this mod uses and/or requires a script extender program, which is not OBSE? There are additional tags in the scripts, e.g. ";<CSEBlock>". Most likely it's Construction Set Extender, which can be found here on Nexus, but I'm not sure. Never used it before.

 

As you have figured out yourself, you can fix the script by using most of the "ARSwitch01", but simply have missed the variable declarations at the top of the script. So a complete script would look like

 

 

scriptname ATPrisonSwitchScript

short busy
ref target
ref mySelf

begin onActivate
if busy == 0
	set ATPrisonGeneral.TeleportMarkerRef to GetParentRef   ;;;;; your stuff
	set target to getParentRef
	set mySelf to getSelf
	target.activate mySelf 1
	playgroup forward 0
	set busy to 1
endif	
end

begin gameMode
if isAnimPlaying == 0 && busy == 1
	set busy to 0
endif
End
;<CSEBlock>
;<CSECaretPos> 123 </CSECaretPos>
;</CSEBlock>

 

Link to comment
Share on other sites

Sadly enough, I only just figured out how to paste text into the script area....

 

At any rate, thank you for the script, works like a charm!

 

My friend that wrote the original script probably employed the use of that CS plugin, at least that is the only reason that I can think of for that extra bit of script being in there.

 

Only two more questions,

1) If I wanted to add a message such as "Area Prepared for Transport" after pressing the button, how would I go about doing that in the script?

2)Can I get rid of those three extra lines of script at the end (since I don't use the plugin) without any ill effects?

Link to comment
Share on other sites

Messagebox "Area Prepared for Transport"

 

or

 

Message "Area Prepared for Transport"

 

The first one makes a box, which you have to click ok, the 2nd version simply displays the text for a few seconds at the edge of your screen. After one of the "set busy to 0/1" statements, depending on when you whant to see it (beginning or end of animation)

 

If you don't use the plugin, you can safely remove the tags. They are simple comment.

 

Have fun :thumbsup:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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