Jump to content

Modders hints and tips


Pineapplerum

Recommended Posts

Comment scripts, huh? What the heck are comment scripts? :confused:

"Comment scripts" meaning to "place comments inside your scripts"

 

Reference: CS Commands

You may add comments to your code by starting the line with a semicolon. A comment is ignored by the game, but allows you to leave yourself notes on what a particular script is doing.

 

In the professional programming world, we typically write out our problem in English. We then write out our solution in English (without trying to use any kind of programming language calls, functions, etc.). This is called Pseudo Code.

 

This "Pseudo Code" is then used as a basis for converting the plain English solution into an actual program. The Pseudo Code usually remains in the end-result as comments.

 

Example:

 

Pseudo Code - English-like statements to provide for an intended solution without going into detail of actual programming language syntax:

If the player's infamy is higher than 50,
 then add a healing spell
 and notify player that spell has been added.

 

CS Script Code: (Comments are non-executed text which are noted by the semi-colon)

scriptname MyHealingSpell
;** If the player's infamy is higher than 50,
If ( player.infamy >= 50 )
 ;**   then add a healing spell
 player.addspell MyHealingSpell
 ;**   and notify player that spell has been added.
 MessageBox “You have acquired the healing spell!”
EndIf

Link to comment
Share on other sites

Comment scripts, huh? What the heck are comment scripts? :confused:

Precisely what LHammond said-- "comment" as a verb. I wasn't very clear. :) I'm very new to modding, so my code is often ungodly confusing; I find it helps to clarify what I'm doing and why:

 

; Okay, first-- are we in Oblivion? If yes, set variable to 1!
; Valtierro won't be there by himself, so we'll check for the player.
; This checks for OblivionRD004 locations. Lots of code snipped because of how godawful long it is.
if player.OblivionRD004Caves == 1 || player.OblivionRD004CitadelLeft == 1 
	set valinhell to 1
      	else
       	set valinhell to 0

; ...because we're not in Oblivion. Carry on!

...okay, I do it to amuse myself sometimes, too; but my primary idea is to keep myself on task as I work my way through. That's also why I do so much planning before I actually do much of the writing. It's a lot easier to sort out the details right off the bat, instead of trying to untangle stuff halfway through. Not to mention, since I'm learning as I go along, it's easier to do things properly the first time, rather than having to go back and fix things. I've already found that out the frustrating way; in one instance, by having to remove conditions and replace them with a variable, once I figured out how to do it properly!

Link to comment
Share on other sites

Well, I'm less of a true modder, than I am a content editor. I know the basic functions of both the Oblivion CS, and the GECK, and one little thing keeps me from stabbing my computer. Do your work while listening to soft jazz. I may prefer punk rock, but it will make things SEEM easier. Oh, and look for a tutorial. I know the GECK has a step by step, hands on sort of thing. I'm not sure if the Oblivion one does though......
Link to comment
Share on other sites

I haven't gotten into scripting yet but I'm going to save this link for when I do and I'll refer back to it and see if it makes any more sense to me.

Thanks for explaining that for me.

 

And I tried installing Geck but it's for Fallout and I got an error message so I just uninstalled it. Thanks anyway, if it does work with Oblivion than I didn't install it right. Duh.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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