UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Elevator Problem

HOT
broken avatar :(
Created 10 years ago
by NaviLlicious
0 Members and 1 Guest are viewing this topic.
4,046 views
broken avatar :(
×
broken avatar :(
Location: usconverse tx
Date Registered: 20 June 2013
Last active: 1 year ago
Posts
85
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
NaviLlicious's Groups
NaviLlicious's Contact & Social LinksNaviLliciousNaviLlusShore
Hey guys I am trying to get an elevator to work like Die Rise but It seems like the script Is skipping the part where It tells the elevator to go up so It just keeps going down, I kept trying to play with It but can't seem to get It to go both up and down this Is the script
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

init()
{
level.elevator = getentarray("dierisevator", "targetname");
level. speed = 10;
level.down = -200;
level.up = 200;
thread elevator_think();
}

elevator_think()
{
thread go_down();
wait 10;
thread go_up();
wait 10;
thread elevator_think();
}

go_down()
{
for( i = 0; i < level.elevator.size; i++ )
{
flag_wait( "electricity_on" );
level.elevator[i] movez (level.down, level.speed);
         }
}

go_up()
{
for( i = 0; i < level.elevator.size; i++ )
{
flag_wait( "electricity_on" );
level.elevator movez (level.up, level.speed);
         }
}
Last Edit: May 28, 2014, 01:50:05 am by NaviLlicious
Marked as best answer by NaviLlicious 10 years ago
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 5 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
This should fix it. Another thing if this doesn't work remove the flag_wait from go_down and go_up and add it to elevator_think instead. I could go further if this doesn't work either.
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

init()
{
level.elevator = getentarray("dierisevator", "targetname");
level. speed = 10;
level.down = -200;
level.up = 200;
for( i = 0; i < level.elevator.size; i++ )
level.elevator[i] thread elevator_think();
}

elevator_think()
{
self thread go_down();
wait 10;
self thread go_up();
wait 10;
self thread elevator_think();
}

go_down()
{
flag_wait( "electricity_on" );
                self movez (level.down, level.speed);
}

go_up()
{
flag_wait( "electricity_on" );
               self movez (level.up, level.speed);
}
Last Edit: May 28, 2014, 01:58:50 am by PROxFTW
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
This should fix it. Another thing if this doesn't work remove the flag_wait from go_down and go_up and add it to elevator_think instead. I could go further if this doesn't work either.
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

init()
{
level.elevator = getentarray("dierisevator", "targetname");
level. speed = 10;
level.down = -200;
level.up = 200;
for( i = 0; i < level.elevator.size; i++ )
level.elevator[i] thread elevator_think();
}

elevator_think()
{
self thread go_down();
wait 10;
self thread go_up();
wait 10;
self thread elevator_think();
}

go_down()
{
flag_wait( "electricity_on" );
                self movez (level.down, level.speed);
}

go_up()
{
flag_wait( "electricity_on" );
               self movez (level.up, level.speed);
}

Might want to put a loop around elevator_think(); Otherwise the code will go once and then stop.
Last Edit: May 28, 2014, 02:05:42 am by daedra descent
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 5 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Might want to put a loop around elevator_think();
In a for or if/else statement if there is only one line of code no brackets are needed.
broken avatar :(
×
broken avatar :(
Location: usconverse tx
Date Registered: 20 June 2013
Last active: 1 year ago
Posts
85
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
NaviLlicious's Groups
NaviLlicious's Contact & Social LinksNaviLliciousNaviLlusShore
This should fix it. Another thing if this doesn't work remove the flag_wait from go_down and go_up and add it to elevator_think instead. I could go further if this doesn't work either.
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

init()
{
level.elevator = getentarray("dierisevator", "targetname");
level. speed = 10;
level.down = -200;
level.up = 200;
for( i = 0; i < level.elevator.size; i++ )
level.elevator[i] thread elevator_think();
}

elevator_think()
{
self thread go_down();
wait 10;
self thread go_up();
wait 10;
self thread elevator_think();
}

go_down()
{
flag_wait( "electricity_on" );
                self movez (level.down, level.speed);
}

go_up()
{
flag_wait( "electricity_on" );
               self movez (level.up, level.speed);
}
That got It working but It doesn't wait the 10 seconds It just goes up and down continuously
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
In a for or if/else statement if there is only one line of code no brackets are needed.

No i meant so it would repeat but i see you just called the function on itself after it does its thing. My bad.  :P
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 5 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
I've seen wait(  ); like this before but don't know why. I would recommend trying that also add the 10 in the (). This could just still be useless but still worth a try.
No i meant so it would repeat but i see you just called the function on itself after it does its thing. My bad.  :P
Oh, thought you were talking about the for loop.
Last Edit: May 28, 2014, 02:11:42 am by PROxFTW
broken avatar :(
×
broken avatar :(
Location: usconverse tx
Date Registered: 20 June 2013
Last active: 1 year ago
Posts
85
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
NaviLlicious's Groups
NaviLlicious's Contact & Social LinksNaviLliciousNaviLlusShore
When It goes down It waits 3 seconds instead of 10 then when It hits the top It goes back down without waiting at all now
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 5 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Here another idea I have is take out the wait 10; and in replace put for( i = 0; i < 10; i++ ) wait 1;
This could still fail but still an attempt.
broken avatar :(
×
broken avatar :(
Location: usconverse tx
Date Registered: 20 June 2013
Last active: 1 year ago
Posts
85
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
NaviLlicious's Groups
NaviLlicious's Contact & Social LinksNaviLliciousNaviLlusShore
Like this?
Code Snippet
Plaintext
elevator_think()
{
self thread go_down();
for( i = 0; i < 10; i++ ) wait 1;
self thread go_up();
for( i = 0; i < 10; i++ ) wait 1;
self thread elevator_think();
}
trying It now
Last Edit: May 28, 2014, 02:31:27 am by NaviLlicious
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 5 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Yep. My last idea if that fails will be using waittill if that doesn't work. If this doesn't work someone else will have to help you as I have to go now.
Waittill Version:
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

init()
{
level.elevator = getentarray("dierisevator", "targetname");
level. speed = 10;
level.down = -200;
level.up = 200;
for( i = 0; i < level.elevator.size; i++ )
level.elevator[i] thread elevator_think();
}

elevator_think()
{
self thread go_down();
self waittill( "Down" );
self thread go_up();
self waittill( "Up" );
self thread elevator_think();
}

go_down()
{
flag_wait( "electricity_on" );
        self movez (level.down, level.speed);
        wait 10;
        self notify( "Down" );
}

go_up()
{
flag_wait( "electricity_on" );
        self movez (level.up, level.speed);
        wait 10;
        self notify( "Up" );
}
Last Edit: May 28, 2014, 02:33:32 am by PROxFTW
broken avatar :(
×
broken avatar :(
Location: usconverse tx
Date Registered: 20 June 2013
Last active: 1 year ago
Posts
85
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
NaviLlicious's Groups
NaviLlicious's Contact & Social LinksNaviLliciousNaviLlusShore
It actually threw the elevator In reverse and instead of going down first It went up lol but It still wasn't waiting when It hit the point

Post Merge: May 28, 2014, 02:42:15 am
Still no luck :/ I will keep toying with It but I really appreciate the help
Last Edit: May 28, 2014, 02:42:15 am by NaviLlicious
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 4 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
When It goes down It waits 3 seconds instead of 10 then when It hits the top It goes back down without waiting at all now

Well of course it isn't going to wait when it hits the top because your level.speed is the exact same as the wait timer, if you increase the wait timer it should wait. haha

or make the wait timer something like

Code Snippet
Plaintext
wait(level.speed + 10);
broken avatar :(
×
broken avatar :(
Location: usconverse tx
Date Registered: 20 June 2013
Last active: 1 year ago
Posts
85
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
NaviLlicious's Groups
NaviLlicious's Contact & Social LinksNaviLliciousNaviLlusShore
Well of course it isn't going to wait when it hits the top because your level.speed is the exact same as the wait timer, if you increase the wait timer it should wait. haha

or make the wait timer something like

Code Snippet
Plaintext
wait(level.speed + 10);
Ah that may be why xD
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 4 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Ah that may be why xD

So did this solve your problem? :P

 
Loading ...