Jump to content
  • 0

Script Argument Error


CaptainManiac

Question

So,i need to make a script that chenges the wall texture of the wall it is applied and when i put a string type argument it shows me invalid variable type error.Why?I am uzing GZDB Latest version.

Share this post


Link to post

11 answers to this question

Recommended Posts

  • 0

I suspect strings aren't valid in this context, since they're highly limited in ACS in general. If you want something to call from scripts, you can try making it a function, but I don't think its possible to call a script with custom string parameters in a map even in udmf.

 

Also that terminate; is superfluous, it'll terminate automatically.

Share this post


Link to post
  • 1

I am new to ACS, so I don't know if this is possible, but maybe you can make a global array of strings, and then pass an index into that array as an argument to your script.

Share this post


Link to post
  • 0
2 minutes ago, everennui said:

Please post your code.

script "ChangeWallTexture"(int side,int sidedef,str name)
{
    SetLineTexture(0,side,sidedef,name);
    terminate;
}

 

 

 

and it is meant to change the texture of the line it is activated by to an user-specified texture,that way a computer or a single screen can receive crack effect,but even the effect isn't coming up.

Share this post


Link to post
  • 0

I think you're missing the script type. It should probably be (void). That's the first thing I notice.

 

Edit: I guess not. The example doesn't use void. Sorry. I can't help, but I think I'm going to look at it for a minute.

Edited by everennui

Share this post


Link to post
  • 0
2 minutes ago, everennui said:

I think you're missing the script type. It should probably be (void). That's the first thing I notice.

The (void) is replaced by three arguments,the side,the sidedef and the texture,two ints and one str.

Share this post


Link to post
  • 0

Here's what worked for me.


#include "zcommon.acs"
Script 1 (void)
{
    SetLineTexture(1, side_front, TEXTURE_BOTTOM, "-");

}



This replaced my switch texture with nothing.

Share this post


Link to post
  • 0

Just comment them out. Use, // or if it's longer than one line /* */.

Script 1 (void)
{
     //Setlinetexture(*,*,*,*); //This will not be looked at.

     .....
     .....
}

/*
Script 1 (void)
{
Setlinetexture(*,*,*,*);
}
*/ None of this will be looked at.

Share this post


Link to post
  • 0
3 minutes ago, everennui said:

Just comment them out. Use, // or if it's longer than one line /* */.
 


Script 1 (void)
{
     //Setlinetexture(*,*,*,*); //This will not be looked at.

     .....
     .....
}

/*
Script 1 (void)
{
Setlinetexture(*,*,*,*);
}
*/ None of this will be looked at.

 

i will make many scripts to be used for different lines,deleted the previous lines.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...