Staredit Network > Forums > Modding Assistance > Topic: Explanation of iScript
Explanation of iScript
Aug 13 2009, 1:49 am
By: Mokushi  

Aug 13 2009, 1:49 am Mokushi Post #1



Okay, a friend of mine attempted to help me make an iScript attack pertaining to shooting stasis fields and ending in an EMP explosion.

Despite my success in making this rather awesome attack, I do not exactly understand how to expand my knowledge of iScript and everything that pertains to it. So I ask the great and powerful modders and mappers on SEN to help clarify the use of this tool.

I know most of the basics like the comments and things of that sort, things like imgol, sprol, etc. are what confuse me.



None.

Aug 13 2009, 2:04 pm Biophysicist Post #2



An iscript entry consists of two distinct parts. One is called the "header" and will be covered later. The other section does not have a name (afaik) and holds the actual iscript code.

Iscript code consists of "opcodes" and "code blocks". Opcodes do various things, such as playing a certain frame/frameset (the playfram opcode [this is not misspelled, there really is no "e"]), creating an image overlay (the imgol opcode), or ending an image (the end opcode). Opcodes are for the most part executed sequentially. This means in the following code:
Code
playfram 0x11
wait 1
end

the playfram would be called first, then wait, then end.

There is a list of iscript opcodes somewhere. If you are using IceCCUI, check your IceCCUI directory. Or I can get you one.

Code blocks are used by the header, the "goto" opcode, and the various "condjmp" opcodes. They consist of a name, a :, and a series of opcodes. This is an example of a code block:

Code
ExampleCodeBlock:
playfram 0x11
wait 1
playfram 0x00
wait 1
goto ExampleCodeBlock


This code block will play frameset 1, wait 1, play frameset 0, wait 1, then jump to itself.

Note that if the code reaches the start of a codeblock, it will keep executing. Take the following code:
Code
ExampleCodeBlock1:
playfram 0x11
wait 1
ExampleCodeBlock2:
setvertpos 1
wait 1
setvertpos 0
wait 1
goto ExampleCodeBlock2


This code will play frameset 1, wait 1, set the image's vertical position to 1 (which causes the image to be drawn one pixel lower than normal), waits 1, sets the image's vertical position to 0 (which causes the image to be drawn at its normal elevation), waits 1, then jumps to "ExampleCodeBlock2".

The last topic that will be covered is the iscript header. The header tells the iscript which code block to call when certain events occur. The header consists of a "type" entry (which specifies which events may occur on this particular image), an IsID entry (which specifies which iscript entry this is), and then a list of events and the associated code block. Look at some existing iscript headers and you should be able to figure it out.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:58 pm]
lil-Inferno -- ya
[2026-4-25. : 11:50 pm]
JamaL -- Glad to see SEN will never die. Kudos to whoever is paying the hosting fees these days!
[2026-4-25. : 3:37 pm]
NudeRaider -- (-.-,)
[2026-4-25. : 3:35 pm]
Zoan -- ;o I thought that was a monkey emote
[2026-4-25. : 3:34 pm]
Zoan -- :mods:
[2026-4-25. : 3:34 pm]
Zoan -- :mods"
[2026-4-25. : 3:20 pm]
NudeRaider -- Vrael
Vrael shouted: moderation? on SEN? in 2026? completely localized in anoeth47's topic? at this time of year?
boy, if you're not careful I'll moderate your sorry ass too!
[2026-4-25. : 3:06 pm]
RIVE -- Yyyes. Don't you see it?
[2026-4-25. : 2:11 pm]
Vrael -- moderation? on SEN? in 2026? completely localized in anoeth47's topic? at this time of year?
[2026-4-25. : 1:39 pm]
NudeRaider -- anoeth47
anoeth47 shouted: Can I get a moderator/lord of the forum to clean up my topics - delete posts not really part of the topic.
send me the links of the posts you want deleted via pm
Please log in to shout.


Members Online: Roy