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

Can i make something move constantly

HOT
broken avatar :(
Created 9 years ago
by denis-24
0 Members and 1 Guest are viewing this topic.
4,579 views
broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
Signature
oylmeo
×
denis-24's Groups
denis-24's Contact & Social Links
Like,i have a brushmodel,can i make it constantly move? For example  left to right,right to left,left to right,right to left and so on...just make it move constantly.
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
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.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
make it a script_brushmodel in radiant, and give it a targetname. My example script is using this one:

Code Snippet
Plaintext
targetname - moving_wall

also add a script vector for the direction and distance it needs to move, just like with a door.

Code Snippet
Plaintext
script_vector  -  100 0 0

and add the kvp count to tell how long it should take to move to the new position:

Code Snippet
Plaintext
count   -  3 



open you mapname.gsc and just below the line:

Code Snippet
Plaintext
maps\_zombiemode::main();

add this line:

Code Snippet
Plaintext
moving_walls();



now scroll to the bottom, add this:

Code Snippet
Plaintext
moving_walls()
{
walls = getentarray( "moving_wall", "targetname" );
array_thread( walls,::make_me_move );
}

make_me_move()
{
for( ;; )
{
self moveto( self.origin+self.script_vector, self.count, 0, 0 );
wait self.count;
self moveto( self.origin-self.script_vector, self.count, 0, 0 );
wait self.count;
}
}

You can put as many of these in your map as you want, and works for both script_brushmodel and script_model as long as you give them that targetname
broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
denis-24's Groups
denis-24's Contact & Social Links
That's so awesome!! Only one thing,i would need to shoot the brushmodel and make it go away,i did this as i would do for any shootable door,but the targetname was shootable_door and now with your way targetname is moving_wall.

Is it possible to do it?
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
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.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
That's so awesome!! Only one thing,i would need to shoot the brushmodel and make it go away,i did this as i would do for any shootable door,but the targetname was shootable_door and now with your way targetname is moving_wall.

Is it possible to do it?

change everywhere where it says "targetname" to "script_noteworthy" both in radiant and the script, and it should work too.

EDIT: if the wall gets deleted at some point in the game, better to use this script prob

Code Snippet
Plaintext
moving_walls()
{
walls = getentarray( "moving_wall", "script_noteworthy" );
array_thread( walls,::make_me_move );
}

make_me_move()
{
for( ;; )
{
self moveto( self.origin+self.script_vector, self.count, 0, 0 );
wait self.count;
                if( !isdefined( self ) )
                       break;
self moveto( self.origin-self.script_vector, self.count, 0, 0 );
wait self.count;
                if( !isdefined( self ) )
                       break;
}
}

Last Edit: March 27, 2015, 10:39:33 pm by BluntStuffy
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
Why not just do self waittill("movedone") instead of a wait?
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
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.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Why not just do self waittill("movedone") instead of a wait?

Yeh, why not.. Forgot about that, still 'need' the count kvp to set the move speed though so doesn't really matter i guess
And just wondering, would it still receive some sort of notify when it gets deleted while moving? Or will the function then just wait forever for the "movedone"?
broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
denis-24's Groups
denis-24's Contact & Social Links
change everywhere where it says "targetname" to "script_noteworthy" both in radiant and the script, and it should work too.

EDIT: if the wall gets deleted at some point in the game, better to use this script prob

Code Snippet
Plaintext
moving_walls()
{
walls = getentarray( "moving_wall", "script_noteworthy" );
array_thread( walls,::make_me_move );
}

make_me_move()
{
for( ;; )
{
self moveto( self.origin+self.script_vector, self.count, 0, 0 );
wait self.count;
                if( !isdefined( self ) )
                       break;
self moveto( self.origin-self.script_vector, self.count, 0, 0 );
wait self.count;
                if( !isdefined( self ) )
                       break;
}
}


I have changed it to script noteworthy,but when i shoot the trigger,the wall/door won't move.  :-[
Last Edit: March 28, 2015, 12:12:05 am by denis-24
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
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.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
I have changed it to script noteworthy,but when i shoot the trigger,the wall/door won't move.  :-[

Now you're mixing up things.. what i did above just make's it move back and forward forever, and has nothing to do with shooting it.
I assumed you had another script that would make it disappear when you shoot it.
What do you want the brush to do exactly?
Last Edit: March 28, 2015, 12:30:29 am by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21'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.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
you need to put "targetname" back to what it was before stuffys code

Stuffys code uses script noteworthy, whatever you used before used "targetname"

If you specify both correctly, both will work on this one object
broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
denis-24's Groups
denis-24's Contact & Social Links
you need to put "targetname" back to what it was before stuffys code

Stuffys code uses script noteworthy, whatever you used before used "targetname"

If you specify both correctly, both will work on this one object

script_noteworthy - moving_wall
targetname - shootable_door
script_vector - 100 0 0
count - 3

That is da brushmodel..

It would move away when i shot a trigger before i added Stuffy's code,but now it doesn't

I need it to move,and when i shoot it,to go away.  :)
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
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.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
script_noteworthy - moving_wall
targetname - shootable_door
script_vector - 100 0 0
count - 3

That is da brushmodel..

It would move away when i shot a trigger before i added Stuffy's code,but now it doesn't

I need it to move,and when i shoot it,to go away.  :)

But it does move back and forward constantly?
Can you show the code you're using to make it shootable?
broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
denis-24's Groups
denis-24's Contact & Social Links
But it does move back and forward constantly?
Can you show the code you're using to make it shootable?

Yes it moves all the time,here is i followed zk's shootable door tutorial:

zk_shootable_door()
{
   door = getEnt("shootable_door" , "targetname");
   shoot_me = getEnt("shoot_me" , "targetname");

   shoot_me waittill("trigger");
   shoot_me delete();
   play_sound_at_pos("door_slide_open" , door.origin);
   door MoveZ (200,5);
   //door MoveY (100, 5);
   //door MoveX (100, 5);
   
   wait 1;

}

Basically,your script works,it is moving,but i would need to shoot it and then it should go away.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
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.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Ok, i wasn't really sure if you want only one of these in your map, or more of them. So i made it possible to make multiple of them if you want to.


1-Keep the trigger(s) you need to shoot, and keep their targetname:  shoot_me

2-Make the moving door/wall have the KVP's:  ( example's )
   script_vector      -      100 0 0         
   count            -      3            

   delete the script_noteworthy and targetname it has now.

   
3-Now select the trigger that belongs to that wall, then select the wall and press 'w' so the trigger now target's the wall.

4-Replace my previous script in your mapname.gsc with this one, and remove ZK's script.


Code Snippet
Plaintext
moving_walls()
{
triggers = getentarray( "shoot_me", "targetname" );
array_thread( triggers,::setup_moving );

}

setup_moving()
{
self endon( "i_have_been_shot" );

door = getent( self.target, "targetname" );
self thread wait_for_hits( door );

for( ;; )
{
door moveto( door.origin+door.script_vector, door.count, 0, 0 );
wait door.count;
door moveto( door.origin-door.script_vector, door.count, 0, 0 );
wait door.count;
            if( !isdefined( door ) )
                break;
}
}

wait_for_hits(door)
{
for( ;; )
{
attacker = undefined;
self waittill( "trigger", attacker );

if( !isplayer( attacker ) )
continue;

break;
}

self notify( "i_have_been_shot" );

play_sound_at_pos("door_slide_open" , door.origin);
door movez(-200,5);
self delete();
door waittill( "movedone" );
door delete();
}
Last Edit: March 28, 2015, 02:01:45 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: hr
Date Registered: 18 October 2013
Last active: 4 months ago
Posts
94
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
denis-24's Groups
denis-24's Contact & Social Links
It basically works,but the trigger still doesn't follow the brushmodel,can that be done? If the trigger doesn't follow it then i can't really shoot where the brushmodel is,i would have to shoot exactly where the trigger is  :poker:
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
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.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
It basically works,but the trigger still doesn't follow the brushmodel,can that be done? If the trigger doesn't follow it then i can't really shoot where the brushmodel is,i would have to shoot exactly where the trigger is  :poker:

lol, i thought the trigger was somewhere else in the map.. I'll change it up a bit

Double Post Merge: March 28, 2015, 03:33:18 pm
k, here we go once more :)
in radiant:
1- delete the triggers,

2- select the moving thingy's and give them the targetname   -   moving_wall
   -keep the script_vector and count KVP

3- use this script


(the doors dont take melee damage or grenade damage)

Code Snippet
Plaintext
moving_walls()
{
walls = getentarray( "moving_wall", "targetname" );
array_thread( walls,::setup_moving );
}

setup_moving()
{
self endon( "i_have_been_shot" );

self thread wait_for_hits();

for( ;; )
{
self moveto( self.origin+self.script_vector, self.count, 0, 0 );
wait self.count;
self moveto( self.origin-self.script_vector, self.count, 0, 0 );
wait self.count;
            if( !isdefined( self ) )
                break;
}
}

wait_for_hits()
{
self setcandamage( true );


for( ;; )
{
self waittill( "damage", amount, attacker, dir, org, mod );

if( !isplayer( attacker ) )
continue;

if( mod == "MOD_GRENADE" || mod == "MOD_GRENADE_SPLASH" || mod == "MOD_MELEE" )
continue;

break;
}

self notify( "i_have_been_shot" );
self setcandamage( false );

play_sound_at_pos("door_slide_open" , self.origin);
self movez(-200,5);
self waittill( "movedone" );
self delete();
}
Last Edit: March 28, 2015, 03:33:18 pm by BluntStuffy

 
Loading ...