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

Screen Shake?

HOT
broken avatar :(
Created 10 years ago
by Naminator999
0 Members and 1 Guest are viewing this topic.
5,215 views
broken avatar :(
×
broken avatar :(
Location: auAustralia
Date Registered: 8 January 2014
Last active: 6 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
×
Naminator999's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
Hi.

Im making a map that is located on a spaceship and want the screen to shake for a few seconds at random intervals with a minimum and maximum wait time.

Could someone please help me script this?

Thanks.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Here you go, note the script is untested. If it doesn't work, I'll fix it.
Code Snippet
Plaintext
#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;

main()
{
thread shake_world();
}

shake_world()
{
        while(1)
        {
               players = get_players();
       for(i=0;i<players.size;i++)
      {
              Earthquake( 3, 4, players[i].origin, 700 );// NUMBER 3 IS HOW BIG THE QUAKE IS, 4 IS THE DURATION OF THE QUAKE IN SECONDS, AND 700 IS EFFECT OF THE QUAKE RADIUS
              //players[i] playsound( "SOUND_NAME" );//JUST ADDED THIS IF YOU WANT A SOUND FOR THE QUAKE, REMOVE THE // AT THE START OF THIS LINE AND ADD A SOUND NAME, IF YOU WANT TO
              }
        wait 20; //CHANGE THIS TO HOW LONG IT TAKES FOR THE EARTHQUAKE TO COME BACK, IN THIS CASE IT WILL COME AFTER EACH 20 SECOND
         }
}
Last Edit: July 21, 2014, 05:02:50 pm by Ege115
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Code Snippet
Plaintext
shake()
{
for(;;){
earthquake(0.3,10,(0,0,0),1000000);
wait(RandomFloat(300));
}
}
Ege, your script makes the earthquake stronger when there are more players.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Code Snippet
Plaintext
shake()
{
for(;;){
earthquake(0.3,10,(0,0,0),1000000);
wait(RandomFloat(300));
}
}
Ege, your script makes the earthquake stronger when there are more players.
Oh yea, you're right. It loops all the players and then it adds some extra values. Sorry my bad, corrected it now. Thanks Ray.
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
Probably want to make the time in between waits random.

Code Snippet
Plaintext
wait = RandomIntRange( 20, 60 ); // change to whatever
          wait(wait);

Like that.
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Oh yea, you're right. It loops all the players and then it adds some extra values. Sorry my bad, corrected it now. Thanks Ray.
GODDAMMIT EGE, now it looks just like my script!
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
GODDAMMIT EGE, now it looks just like my script!
I assumed you wanted me to corrrect my script with your example. Sorry, I change it then.::)
Last Edit: June 19, 2014, 11:34:11 am by Ege115
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Probably want to make the time in between waits random.

Code Snippet
Plaintext
wait = RandomIntRange( 20, 60 ); // change to whatever
          wait(wait);

Like that.
randomIntRange is max + 1, so 60 would be 61.
broken avatar :(
×
broken avatar :(
Location: auAustralia
Date Registered: 8 January 2014
Last active: 6 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Naminator999's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
If i'm using UGX Mod would i need to add the wait for voting to complete code.

Code Snippet
Plaintext
level waittill("ugxm_voting_complete");
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
If i'm using UGX Mod would i need to add the wait for voting to complete code.

Code Snippet
Plaintext
level waittill("ugxm_voting_complete");
If you're calling the thread AFTER the zombiemode, there's no need for that.
broken avatar :(
×
broken avatar :(
Location: auAustralia
Date Registered: 8 January 2014
Last active: 6 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Naminator999's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
If you're calling the thread AFTER the zombiemode, there's no need for that.

Ok. Thanks

Post Merge: June 25, 2014, 06:42:20 am
Code Snippet
Plaintext
shake()
{
for(;;){
earthquake(0.3,10,(0,0,0),1000000);
wait(RandomFloat(300));
}
}

Hey Ray. How do add a delay so that the shaking does not start straight away after spawning.

Also how do i add a minimim wait between shakes.

I tried daedras wait code but i kept getting a bad syntax error.

Probably want to make the time in between waits random.

Code Snippet
Plaintext
wait = RandomIntRange( 20, 60 ); // change to whatever
          wait(wait);

Like that.
Last Edit: June 25, 2014, 06:55:56 am by Naminator999
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
Ok. Thanks

Post Merge: June 25, 2014, 06:42:20 am
Hey Ray. How do add a delay so that the shaking does not start straight away after spawning.

Also how do i add a minimim wait between shakes.

I tried daedras wait code but i kept getting a bad syntax error.

delete the extra tab on the wait line.
broken avatar :(
×
broken avatar :(
Location: auAustralia
Date Registered: 8 January 2014
Last active: 6 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Naminator999's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
delete the extra tab on the wait line.
Still get bad syntax error.

Here's the code
Code Snippet
Plaintext
//Screen Shake
shake()
{
for(;;){
earthquake(0.3,3,(0,0,0),1000);
wait = RandomIntRange( 20, 60 ); // change to whatever
wait(wait);
}
}
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Use my code, as it should affect the whole map. Add a wait(10); before the for loop.
broken avatar :(
×
broken avatar :(
Location: auAustralia
Date Registered: 8 January 2014
Last active: 6 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Naminator999's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
Use my code, as it should affect the whole map. Add a wait(10); before the for loop.

What about a min and max wait time between shakes. I don't want the screen to shake 2 seconds after it already has you see nor too far apart
Last Edit: June 25, 2014, 07:24:45 am by Naminator999

 
Loading ...