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.
[10:41 am]
ManCubuS -- Seems like something's broken regarding the site then. Sadge...
[07:36 am]
Oh_Man -- have i ever told u guys my SC2 pro-gamer story
[11:30 pm]
Ultraviolet -- That's strange, it looks like you targeted the base image file (sometimes people make the mistake of just using the imgur page link which doesn't work for embedding) but it still didn't work it sounds like.
[2026-7-26. : 3:34 pm]
ManCubuS -- Used : " [img=https://i.imgur.com/gpOjTuD.jpeg] "
[2026-7-26. : 3:28 pm]
ManCubuS -- Even tried with imgur, doesn't attach.
[2026-7-26. : 3:14 pm]
ManCubuS -- I should try a workaround, thanks! Sadly imgur is blocked in my country for some unknown reason.
[2026-7-26. : 3:05 pm]
NudeRaider -- I think SEN has trouble with https or hotlinking is forbidden. It certainly is nothing about the size, it just fails to get any size. You can get it working if you use imgur and include the actual image link for the img tag. Like this: [img=https://i.imgur.com/ddYqXZa.jpeg]
[2026-7-26. : 11:15 am]
ManCubuS -- Hey fellas! Anyone knows why when I try to upload an image it says "failed to get image size"? I even tried making it so small. Imgur isn't working here and I tried postimg no luck.
[2026-7-23. : 6:40 am]
Oh_Man -- true
[2026-7-23. : 3:16 am]
RIVE -- Still annoyed there was never a trigger to stop or pause wavs.
Please log in to shout.


Members Online: Zycorax, Dem0n