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

help me with this script

Recommended Posts

I try to use acs to open a door:

script 2 (void)
{
if (CheckInventory("BlueCard"))
Door_Open (1, 16);
Delay (35*5);
Door_Close (1, 16);
}
else
Print(s:"You need the blue key.");
}

Then the script editor says: invalid declarator - line 8 - the word "else".
What should I the Newbie do?

Share this post


Link to post

You are missing an opening curly bracket here:

if (CheckInventory("BlueCard")) {

By the way, better use ACS locked scripts than this workaround. They show as colours on the automap, which is convenient.

Share this post


Link to post

Thank you very much, that worked.
I'm new to this script stuff and will check out this "locked" tutorials for better understanding.

Share this post


Link to post

on with new one.

How do i make 3d floor that is deep-water and transparent in a map doom in hexen format?

Share this post


Link to post

tried it but didn't work.
Sorry I'm a noob to this hexen format thing, so should i make a scipt or lindef action for that?

script 2 OPEN
{
Sector_Set3dFloor(1, 3,64);
}
the editor says: function Set3dFloor is used but not defined.

Share this post


Link to post
saifi said:

tried it but didn't work.
Sorry I'm a noob to this hexen format thing, so should i make a scipt or lindef action for that?

script 2 OPEN
{
Sector_Set3dFloor(1, 3,64);
}
the editor says: function Set3dFloor is used but not defined.


Linedef action.


Similar to 3d floors.

http://i.imgur.com/Lu3hKMh.png

..And as you know, It will be as deep as the sector height. Make sure you uncheck "solid"


Make sure to tag your 3d sector the same as the linedef action.

Share this post


Link to post
saifi said:

script 2 OPEN
{
Sector_Set3dFloor(1, 3,64);
}
the editor says: function Set3dFloor is used but not defined.

It gave you an error because a script lump should start with a line:

#include "zcommon.acs"
If it didn't, the compiler would always complain, because it wouldn't know the functions you wanted to use; ZDoom functions are defined in "zcommon.acs".

Share this post


Link to post

That's true in general, but Sector_Set3dFloor and a couple of other action specials cannot be used in a script.

Share this post


Link to post

Another one on the way...
I just learnt how to make monsters appear via mapspots, but now i have a problem:

script 4 (void)
{
SpawnSpot ("DoomImp", 1, 1);
SpawnSpot ("TeleportFog", 1, 1);
while(thingcount(0,1)>0)
{
delay(35);
}
Door_Open(6, 32);
}

the thing is the door which is tagged 6 doesn't really open. So i figured the script is wrong?

what do you think?

Share this post


Link to post

Give the summoned imps different thing IDs than the map spots; what's happening is that while(thingcount(0,1)>0) is counting the map spots.

You can change while(thingcount(0,1)>0) to while(thingcount(T_IMP,1)>0) instead, but that's less flexible in general since you are limited to one type of monster.

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
×