Gez
Why don't I have a custom title by now?!
Posts: 7036
Registered: 07-07 |
Solarn said:
(the format of comments in the script is directly lifted from the Hexen levels, as I found it nice and clear)
Wait. Your version of Hexen has commented scripts in it?
*Looks at map.*
Oh well, I guess you mean the comments that are generated by the decompiler... Also explains why the variable names are extremely unhelpful in the long term. Hint: don't call them "mapvarX", give them names that correspond to what they do. Once you get to a scripts lump with a hundred scripts in it and several dozen map variables, it'll be much more helpful to have "deadettins" (for example) rather than "mapvar77".
My first advice would be to renumber your tags. Write a clean script and use tags accordingly.
code: script 1 (int arg0, int arg1)
{
// arg0 is the class: 0 for fighter, 1 for cleric, 2 for mage
// Those values correspond to the hardcoded results from PlayerClass()
// arg1 is the side: 0 for right, 1 for left
int i; // i for iterator.
if (PlayerClass(PlayerNumber) == arg0)
{
// Tags are as such:
// 1: fighter right window sector
// 2: fighter left window sector
// 3: fighter right window mapspot
// 4: fighter left window mapspot
// 5: cleric right window sector
// 6: cleric left window sector
// 7: cleric right window mapspot
// 8: cleric left window mapspot
// 9: mage right window sector
// 10: mage left window sector
// 11: mage right window mapspot
// 12: mage left window mapspot
Floor_LowerInstant((arg0*4 + arg1 + 1), 0, 16);
thingsound((arg0*4 + arg1 + 3), "GlassShatter", 127);
delay(const:1);
i = 40;
while(i > 0)
{
i--;
Thing_ProjectileGravity((arg0*4 + arg1 + 2), random(54, 63), random(0, 255), random(10, 40), random(5, 20));
}
}
}
|