Password door problems [split from old topic]

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Jb_007
Posts: 1
Joined: Wed Oct 18, 2017 10:52 am

Password door problems [split from old topic]

Post by Jb_007 »

i am creating a password door but only one input 1 character at a time
create a room, create 3 switches and execute code with 1 switch eg switch 1 script 1 etc
#include "zcommon.acs"
str alpha[26]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
str store;
str getinput;
str chk="c";
int count=-1;
function void showalpha(void)
{
count++;
getinput=alpha[count];
print(s:getinput);
}
function void stor(void)
{
store=getinput;
print(s:store);
}
function void ck(void)
{
if (chk==store) {
print(s:"Welcome!!");
}else{
print(s:"invalid password!!");
}
}
script 1 (void) {
showalpha();
}
script 2 (void)
{
stor();
}
script 3 (void)
{
ck();
}

Return to “Scripting”