Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Swec

Script problems DB2

Recommended Posts

Hello.

I try to get a script to work but i get some trouble.

#include "zcommon.acs"
script 1000 (VOID)
{
    //Alarm player of artillery Reguest
    Print(S: "INCOMMING ARTILLERY!"); //The Text messange that is displayed.
    
    //Short Delay Until artillery begins.
    Delay(130);

    //Lanch Artillery
    for(int i = 0; i < 30; i++ )
{ 
    delay(35); // Time between projectiles
    Thing_projectile(random 141,163),127, 90, 0, -100);
}
In game i get i think it stand ' P_startscript:unknown script 232


My trigger is a line and the action 80 and script number 1000. player walks over.

Share this post


Link to post

If the script is called by a line, unless the map is in UDMF, you can't go past 255, because that value is written as a single byte. So any multiple of 256 is removed. In other words, 1000 in hexadecimal representation is 3E8, which would need two bytes to be represented: one with 03, the other with value E8. But only the least significant byte gets written, so you don't have 3E8 but just E8. And E8 in decimal is 232. (In a more mathematical way, 1000/256 = 3, with a remainder of 232.)

So you need to give your script a number lower than 1000. For example, 232 since that's what your map expects.

Share this post


Link to post

ohh it is that easy? i just set 1000 .

ohh i forget Doom in ZDoom

EDIT: I tried some other tags/ script numbers but i get same error. it just change the numbers.

Share this post


Link to post

That script shouldn't even compile.

Thing_projectile(random 141,163),127, 90, 0, -100);
should be something like
Thing_projectile(random(141,163),127, 90, 0, -100);

Share this post


Link to post

Thanks.

But i still got the same problem.
The script complies whiteout errors.

i can't figure out what is wrong. most be something in my WAD that gives errors. :(

Share this post


Link to post

As I said:

#include "zcommon.acs"
script 232 (VOID)
{
    //Alarm player of artillery request
    Print(S: "INCOMING ARTILLERY!"); //The Text message that is displayed.
    
    //Short Delay Until artillery begins.
    Delay(130);

    //Lanch Artillery
    for(int i = 0; i < 30; i++ )
{ 
    delay(35); // Time between projectiles
    Thing_projectile((random 141,163),127, 90, 0, -100);
}
Since you're using Doom in Hexen format, you cannot use a script number higher than 255! 1000 is too much, so the map substract 768 (3*256) from it and instead of calling script 1000, it calls script 232.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×