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

Betty Trigger Help

broken avatar :(
Created 11 years ago
by jbird
0 Members and 1 Guest are viewing this topic.
2,664 views
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
×
jbird's Groups
Code Snippet
Plaintext
betty_think()
{
wait(2);
trigger = spawn("trigger_radius",self.origin,9,80,64);
trigger thread player_trigger(); //line that calls the script
trigger waittill( "trigger" );
trigger = trigger;
self playsound("betty_activated");
wait(.1);
fake_model = spawn("script_model",self.origin);
fake_model setmodel(self.model);
self hide();
tag_origin = spawn("script_model",self.origin);
tag_origin setmodel("tag_origin");
tag_origin linkto(fake_model);
playfxontag(level._effect["betty_trail"], tag_origin,"tag_origin");
fake_model moveto (fake_model.origin + (0,0,32),.2);
fake_model waittill("movedone");
playfx(level._effect["betty_explode"], fake_model.origin);
earthquake(1, .4, fake_model.origin, 512);

//CHris_P - betties do no damage to the players
zombs = getaispeciesarray("axis");
for(i=0;i<zombs.size;i++)
{
//PI ESM: added a z check so that it doesn't kill zombies up or down one floor
if(zombs[i].origin[2] < fake_model.origin[2] + 80 && zombs[i].origin[2] > fake_model.origin[2] - 80 && DistanceSquared(zombs[i].origin, fake_model.origin) < 200 * 200)
{
zombs[i] thread maps\_zombiemode_spawner::zombie_damage( "MOD_ZOMBIE_BETTY", "none", zombs[i].origin, self.owner );
}
}
players = get_players();
for(i=0;i<players.size;i++)
{
//iprintln( Distance( players[i].origin , self.origin ) );
if( players[i].origin[2] < fake_model.origin[2] + 80 && players[i].origin[2] > fake_model.origin[2] - 80 && Distance( players[i].origin , fake_model.origin ) <= 200 && players[i] != self.owner )
{
if(players[i].health > 50)
{
players[i] DoDamage( 160, self.origin );
}
else
{
radiusdamage(players[i].origin,10,players[i].health + 100,players[i].health + 100);
}
}
}

trigger delete();
fake_model delete();
tag_origin delete();
if( isdefined( self ) )
{
self delete();
}
}
Code Snippet
Plaintext
player_trigger() //self = trigger
{
while(1)
{
players = get_players();
for(i=0;i<players.size;i++)
{
if (players[i] isTouching (self) && players[i] != self.owner) //line that needs fixing
{
self notify( "trigger" );
break;
}
}
wait (0.05);
}
}

I got it so bouncing betties can be activated by players, the only thing I want to fix is that I want the player who placed the betty not to be able activate their own betty. What I have currently doesn't work, any suggestions?
Last Edit: June 21, 2015, 08:21:31 am by jbird
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
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
Small rant:
Spoiler: click to open...
Yet another help topic created by you so other people can look through your terrible code and fix your mistakes.

Whatever. That is what the help desk is for, it just rubs me the wrong way when:

A. You haven't credited anyone in your FFA mod on factory or any of your tutorials

B. Your code is god awful.

C. You don't listen to people when they tell you your code is wrong/not the right way to do it.

self.owner isn't defined.

Other issues:
The .origins on AI, players, and entities are NOT arrays and CANNOT have an index.
Setting the variable 'trigger' to itself is pointless and does nothing.

And just gonna leave this here: http://ugx-mods.com/forum/index.php?topic=2891.0





Last Edit: June 21, 2015, 09:06:21 am by daedra descent
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
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.
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 LinksHarryBo000[email protected]HarryBo21
youve threaded it on the trigger not the betty so

self.owner

is not checking the betty, its checking the trigger, which is undefined

Quote
Setting the variable 'trigger' to itself is pointless and does nothing.

That one is treyarchs bad, heres the original

Code Snippet
Plaintext
betty_think()
{
wait(2);
trigger = spawn("trigger_radius",self.origin,9,80,64);
trigger waittill( "trigger" );


trigger = trigger;
self playsound("betty_activated");
wait(.1);
fake_model = spawn("script_model",self.origin);
fake_model setmodel(self.model);
self hide();
tag_origin = spawn("script_model",self.origin);
tag_origin setmodel("tag_origin");
tag_origin linkto(fake_model);
playfxontag(level._effect["betty_trail"], tag_origin,"tag_origin");
fake_model moveto (fake_model.origin + (0,0,32),.2);
fake_model waittill("movedone");
playfx(level._effect["betty_explode"], fake_model.origin);
earthquake(1, .4, fake_model.origin, 512);

//CHris_P - betties do no damage to the players
zombs = getaispeciesarray("axis");
for(i=0;i<zombs.size;i++)
{
//PI ESM: added a z check so that it doesn't kill zombies up or down one floor
if(zombs[i].origin[2] < fake_model.origin[2] + 80 && zombs[i].origin[2] > fake_model.origin[2] - 80 && DistanceSquared(zombs[i].origin, fake_model.origin) < 200 * 200)
{
zombs[i] thread maps\_zombiemode_spawner::zombie_damage( "MOD_ZOMBIE_BETTY", "none", zombs[i].origin, self.owner );
}
}
//radiusdamage(self.origin,128,1000,75,self.owner);

trigger delete();
fake_model delete();
tag_origin delete();
if( isdefined( self ) )
{
self delete();
}
}
Last Edit: June 21, 2015, 09:07:38 am by Harry Bo21
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
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
That one is treyarchs bad, heres the original

I know, i was just pointing out it wasn't necessary.  ;)
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
youve threaded it on the trigger not the betty so

self.owner

is not checking the betty, its checking the trigger, which is undefined

That one is treyarchs bad, heres the original

Code Snippet
Plaintext
betty_think()
{
wait(2);
trigger = spawn("trigger_radius",self.origin,9,80,64);
trigger waittill( "trigger" );


trigger = trigger;
self playsound("betty_activated");
wait(.1);
fake_model = spawn("script_model",self.origin);
fake_model setmodel(self.model);
self hide();
tag_origin = spawn("script_model",self.origin);
tag_origin setmodel("tag_origin");
tag_origin linkto(fake_model);
playfxontag(level._effect["betty_trail"], tag_origin,"tag_origin");
fake_model moveto (fake_model.origin + (0,0,32),.2);
fake_model waittill("movedone");
playfx(level._effect["betty_explode"], fake_model.origin);
earthquake(1, .4, fake_model.origin, 512);

//CHris_P - betties do no damage to the players
zombs = getaispeciesarray("axis");
for(i=0;i<zombs.size;i++)
{
//PI ESM: added a z check so that it doesn't kill zombies up or down one floor
if(zombs[i].origin[2] < fake_model.origin[2] + 80 && zombs[i].origin[2] > fake_model.origin[2] - 80 && DistanceSquared(zombs[i].origin, fake_model.origin) < 200 * 200)
{
zombs[i] thread maps\_zombiemode_spawner::zombie_damage( "MOD_ZOMBIE_BETTY", "none", zombs[i].origin, self.owner );
}
}
//radiusdamage(self.origin,128,1000,75,self.owner);

trigger delete();
fake_model delete();
tag_origin delete();
if( isdefined( self ) )
{
self delete();
}
}
How do I get betty.owner in the thread?
Marked as best answer by jbird 11 years ago
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
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
How do I get betty.owner in the thread?

Code Snippet
Plaintext
trigger thread player_trigger(self.owner);

Code Snippet
Plaintext
player_trigger(owner)

Code Snippet
Plaintext
if (players[i] isTouching (self) && players[i] != owner)

broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
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 LinksHarryBo000[email protected]HarryBo21
thread it on the betty?

add that value to the trigger?

you really need to look up the basics, not hating, but adding a argument to a function is scripting lesson number 1....
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
thread it on the betty?

add that value to the trigger?

you really need to look up the basics, not hating, but adding a argument to a function is scripting lesson number 1....
Never had to do that before, now I know for future reference
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
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 LinksHarryBo000[email protected]HarryBo21
youve never had to use a argument in a function?...

seriously. im not hating, you NEED to go look up the basics if you wanna get better...

 
Loading ...