Jump to content

Photo

General Script Questions #1

- - - - -

  • This topic is locked This topic is locked
391 replies to this topic

#1
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards

General Script Questions


1. Use this thread to ask question about scripts.

2. Use this thread to request classes on scripting topics.

3. Use this thread to ask if something you want to do can be scripted.

4. Just need to say something about anything, use this thread.

NOTE: Only vanilla scripts are discussed in this forum. I do not code using OBSE.
  • 0

#2
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards
I have added more to the Second class. The IF family.

Am I being too verbose?

Am I not explaining it well enough?

Is it just lame?

Or, you just don't care because you will never need script?


Since the class is for you, I need your input.

(PS. Please reply here...)
  • 0

#3
DirtieHippie

DirtieHippie

    Layman

  • Allies
  • 6 posts
You made mention of and/or statements in the if class.  But no explanations.  Doesn't the oblivion scripting language use && for and statements, and || for or statements?  Or something like that?

And sorry for posting a question there.  Didn't notice the disclaimer at the bottom saying not to.
  • 0

#4
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards
Ah yes, I sort of only brushed on the use of AND and OR as they are used in scripts.

Since I am trying to explain what they are in simple english, I have not put their official code use in the page yet. I have a feeling it may span a couple more pages...

I will add the AND and OR to the place where I specify the equals and stuff.

Thanks for the comment.  http://tesalliance.org/forums/public/style_emoticons/default/aa_biggrin.gif
  • 0

#5
_echo

_echo

    Captain

  • TESA Team II
  • 1,208 posts


Users Awards
From what ive read, it all looks good to me. I already know all the stuff thus far so I cant really say too much about it.
  • 0

#6
DarkRider

DarkRider

    Site Commander

  • TESA Team
  • 10,497 posts


Users Awards
I've picked up on some skills at your heel over the last several months, but I'm still learning stuff here! Great class so far!  http://tesalliance.org/forums/public/style_emoticons/default/aa_biggrin.gif
  • 0

#7
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards
I was just wondering if I should continue with the explanation if IF logic in english, or just dive into scripting?

IF what I have explains the concept enough, THEN I will continue, ELSE I will try to explain the IF concept some more. I think if you don't get the concept by the time you read what I have there, you probably should not be scripting? Its hard to tell since I understand it, and it almost drives me mad to try and explain it at this level...

Questions, comments, concerns?
Or should I just take an english class and learn grammer?  http://tesalliance.org/forums/public/style_emoticons/default/aa_biggrin.gif
  • 0

#8
DarkRider

DarkRider

    Site Commander

  • TESA Team
  • 10,497 posts


Users Awards
I would say go ahead and dive into scripting. In the VAP workshops I use the SMARTY icon with Smarty Says (viewable for you in the headmaster's office) to add in little quips of info that might be relevant. You might consider using a similar technique, i.e. go ahead and start delving into scripting, but add a "tip" to clarify something that might not have been covered in depth in the basics lesson.  :simba:
  • 0

#9
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards
Sage advice. Let me think on how to proceed with the class...
  • 0

#10
Windmill Tilter

Windmill Tilter

    Lt. Commander

  • TESA Team
  • 819 posts


Users Awards
I'll second that, I think you've explained the concept very clearly so it should be safe to move on. Anyone who needs further clarification can always ask for it in this thread.

WT
  • 0

#11
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards
Thanks for the comments. I will have more time this weekend to work on it. Have a lot on my plate at the moment.

And I spent a little bit of time finding the perfect location for the 'Tavern' and putting up a basic burned building...
  • 0

#12
forevernomad

forevernomad

    Layman

  • Allies
  • 1 posts
The classes have been great so far, well ok both of them :wave: They were very simple and easy to understand. I think your idea for very basic classes is great as I have spent more time trying to read the CSWiki than actually script because the tutorials there are either incomplete, wrong, too advanced for a novice or the information is so well hidden it may as well be secret (how many lines of code can a script hold?)

Personally I like to tear things up to see how they work, I've started doing this with some of the mods I have installed, but there are so many functions, variables and game settings used that even a very simple if block can be overwhelming when everything between the if/endif is ref.function.var.stage 1 cos 4 tan 7 arc flippertygibbet != wotchamatcallit.

I would like to see code snippets at the end of each class, like homework :lmao: so that once you have taught us an aspect we can go off and try to figure out how short simple scripts work with real world examples. Like a sword that only Orcs can wield, or a spell that will only work on male npcs. We can always come back here and ask if we have issues I would like to think that if everyone asking for help on the bethsoft forums could be directed here it would take a lot of the work out as we are a very helpful bunch, but I think that being able to understand what some of the actual variables and constants are and how they are used would be a big step for many of us newbs.
  • 0

#13
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards
There are so many variations on what you can put in a script, it would be difficult to even go over a few of them.

I will put a Homework script in the IF/ELSE/ELSEIF/ENDIF class. And give an answer.

Then some possible variations using different functions.
  • 0

#14
DaMage

DaMage

    Moderator

  • Moderators
  • 1,067 posts


Users Awards
hmm...i see that you are not going to be dealing with any questions about OBSE. While i am stll learning scripting myself, i have got a bit of experiance using OBSE functions, so send a PM my way if anyone asks about or is using an OBSE function.


PS: damn my 'k' key seems to be getting stuc.
  • 0

#15
Jheuloh

Jheuloh

    Blade

  • Allies
  • 1,506 posts


Users Awards
)_) (_(

Pssst... what's wrong with my script?

Currently, I have is a script attached to a pearl with this in it;

scriptname WilsonSummonScript

Begin OnEquip

; WilsonRef.MoveTo Player 128,0,0

End

The actor Wilson wont move to my location, however, when I press the item. What have I done wrong? x_X
  • 0

#16
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards
Does your script have the ';' semi-colon in it? That makes the whole line a comment.
Nothing would happen on equiping the item.

Or, the pearl is not equipable, depending on how you creted it.
  • 0

#17
Jheuloh

Jheuloh

    Blade

  • Allies
  • 1,506 posts


Users Awards
Oh.

That would explain somethin' then. (The ; character.)

The pearl isn't technically equipable either, I just use OnEquip for lack of a better term. (Would Begin onactivate be more appropriate?)
  • 0

#18
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards
onactivate would only work on an item in the world, and the player would have to 'activate' it.

OnEquip should work fine by clicking on it in the inventory.
  • 0

#19
DarkRider

DarkRider

    Site Commander

  • TESA Team
  • 10,497 posts


Users Awards
Scholar!
I had a question concerning a basic moveto script. I have a scripted ladder in an exterior cell. I want it so that when the player or NPC activates the ladder they will be moved to the top of it. This is my script.

scn RCCatsCradleLadder01SCRIPTbegin onactivate     player.MoveTo Ladder01Markend


I have one issue and one question. First, the current script designates the player activating, will this still work for NPCs or will I need a second command to include other actors? Second, my strange issue, the script properly deposits the player at the mark designated, but the weather spontaneously changes (bottom of the ladder sunshine top of the ladder thunderstorm) it breaks immersion. Is there a way to change that effect?

Thanks!
  • 0

#20
WillieSea

WillieSea

    Senior Scholar

  • Skyrim Scholars
  • 4,797 posts


Users Awards
NPC's WILL NOT activate your ladder, no matter what! (capital case used for emphasis) (unless they are 'scipted' to do so which is not really feasible)

I suggest you turn the ladder into a 'door' object and use the normal door teleporting routine. NPC's WILL use doors. But since the door does not go to another cell, you will HAVE to set one of the doors in its own 'sub-space' area so the AI knows to look for a door when calculating how to move in a single cell.

I believe using the 'door' will eliminate the rapid weather change as well. Otherwise, you may need to script that gets the current weather at the start. and forces the same weather at the destination.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users