Doom monster
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > Semicolon Help
 
Author
All times are GMT. The time now is 13:28. Post New Thread    Post A Reply
wildheart354
Newbie


Posts: 4
Registered: 03-13


I am writing a script to open a door when the player crosses a line, but only if they possess the yellow skull key.

I want it to repeatedly check whether the player possesses the yellow skull key every time they cross the line, and open the door if so, but only if the door has not been opened using the script before.

I came up with this:

script 4 (void)
{
for ( int i = 0; i < 1; i++ && CheckInventory("YellowSkull") >0)
{
Ceiling_RaiseByValue(16,16,112);
}
}

The script editor says that I am missing a semicolon on the line beginning with 'for' but I have no idea where to put it.

If you know what I could change to make it work, then that would be great, whether that's knowing where the semicolon should be, or telling me how to change the script so it works but still has the same effect.

Thanks in advance.

Old Post 09-23-13 19:36 #
wildheart354 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
gggmork
If you can make any sense of this post, congratulations


Posts: 2713
Registered: 06-07


Probably something like this, rusty pseudocode w/ wrong syntax. Your for structure had too much stuff after i++ which caused the error probably. And you don't need a for I think (that's a loop). You just need a single if check because that line is repeatably crossable probably. This might be wrong, didn't try it at all:

dooropened=0
script 4(void)
{
if dooropened==0 and checkinventory(yellow bla):
{
dooropened=1
ceiling raise(bla)
}
}

Old Post 09-23-13 22:15 #
gggmork is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Alteus
Mini-Member


Posts: 76
Registered: 08-12


How about this:

Script 1 (void)
{
if(CheckInventory("YellowSkull") == TRUE)
{
Ceiling_RaiseByValue(16,16,112);
}
}

Edit: oh, I didn't read that second instruction... hrm, thinking:)

Edit2: If your intention is that anyone not having yellow skull cannot pass that door, how about doing a normal YS-door and before that one placing this script?

Script 9 (void) //Thrust away from yellow door if no skull
{
if(CheckInventory("YellowSkull") == FALSE)
{
ThrustThing(X,Y);
}
}

X is the angle, (0-east,64-north,128-west,192-south)
Y is the force.

That should thrust anyone without skull away ._.

Last edited by Alteus on 09-24-13 at 08:42

Old Post 09-24-13 08:08 #
Alteus is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
wildheart354
Newbie


Posts: 4
Registered: 03-13


I want the door opening to be a monster closet that only opens if the player has the yellow skull key when the line is crossed.

Because if the door opens without the player having the key then it will ruin the surprise because a labyrinth rises up when the player gets the key.

EDIT: I think I've sorted it, I've changed the script to:

script 4 (void)
{
if (CheckInventory("YellowSkull") >0)
{
Door_Open (16, 16, 0);
}
}

because that seems to make the door open only if it was closed to start with. (Instead of the door going further up the wall every time the line is crossed.)

Last edited by wildheart354 on 09-24-13 at 17:23

Old Post 09-24-13 16:37 #
wildheart354 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Filled with the code of Doom


Posts: 7473
Registered: 07-00


Looks like you confused if() and for() statements, then. They do completely different things.

Old Post 09-30-13 09:23 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 13:28. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > Semicolon Help

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.