Sign in to follow this  
Followers 0
Punk

bounce function

13 posts in this topic

hello humans, I need some help

 

I want to know how the Bounce function works. (Yes I tried in different numbers)

 

If you guys could show me, the difference in code between a big bounce like in qube and a small bounce like in another map. I would be grateful :okay:

 

Also I'm trying this while you're sliding.... (Yes while you're sliding, I want the player the bounce like 256 units up)

 

 

:kingdave:

0

Share this post


Link to post
Share on other sites
PushPlayer( trigger )
{
	self endon("disconnect");

	self.speed = true;

	if(distance(trigger.origin, self.origin) > 400) // then the player tried to load-glitch the speed
	{
		self freezeControls(true);
		wait 0.1;
		self freezeControls(false);
	}

	else
	{
		target = getEnt(trigger.target, "targetname");
		speed = int(strTok(trigger.script_noteworthy, ",")[0]);

		self.health    = 1000000;
		self.maxhealth = 1000000;

		self thread adminOff();
		setDvar("g_knockback", (speed*9)-3000);
		self finishPlayerDamage(self, self, (speed*9)-3000, 0, "MOD_FALLING", "deserteaglegold_mp", trigger.origin, (trigger.origin - target.origin), "head", 0);
		wait 0.05;
		setDvar("g_knockback", level.knockback);

		trigger playSound(strTok(trigger.script_noteworthy, ",")[1]);

		self notify("admin_on");

		self.health    = 100;
		self.maxhealth = 100;
	}

	while(self isTouching(trigger))
		wait 0.05;

	self.speed = undefined;
}

All credits goes to //Xenon\\

 

0

Share this post


Link to post
Share on other sites
PushPlayer( trigger )
{
	self endon("disconnect");

	self.speed = true;

	if(distance(trigger.origin, self.origin) > 400) // then the player tried to load-glitch the speed
	{
		self freezeControls(true);
		wait 0.1;
		self freezeControls(false);
	}

	else
	{
		target = getEnt(trigger.target, "targetname");
		speed = int(strTok(trigger.script_noteworthy, ",")[0]);

		self.health    = 1000000;
		self.maxhealth = 1000000;

		self thread adminOff();
		setDvar("g_knockback", (speed*9)-3000);
		self finishPlayerDamage(self, self, (speed*9)-3000, 0, "MOD_FALLING", "deserteaglegold_mp", trigger.origin, (trigger.origin - target.origin), "head", 0);
		wait 0.05;
		setDvar("g_knockback", level.knockback);

		trigger playSound(strTok(trigger.script_noteworthy, ",")[1]);

		self notify("admin_on");

		self.health    = 100;
		self.maxhealth = 100;
	}

	while(self isTouching(trigger))
		wait 0.05;

	self.speed = undefined;
}

All credits goes to //Xenon\\

 

that script isn't made by xenon ;)

0

Share this post


Link to post
Share on other sites

that script isn't made by xenon ;)

 

I...I don't care... Help pls :dave:

0

Share this post


Link to post
Share on other sites
player braxi\_common::bounce( <(vec3)direction of where the 'kick' comes from> ), <(int) strength> );

Example where player is bounced verticaly:

player braxi\_common::bounce( vectorNormalize( player.origin - (player.origin - (0,0,1)) ), 500 );
0

Share this post


Link to post
Share on other sites

Heres a bounce pad script from waterworld, it works for me but, I don't know if it's what you're looking for? 

Bouncer(who)
{
	oldpos = who.origin;
	strenght = 3;
	for(i=0;i<strenght;i++)
	{
	    who.health += 170;
        who finishPlayerDamage(who, level.jumpattacker, 170, 0, "MOD_FALLING", "jump_mp", who.origin, AnglesToForward((-90,0,0)), "none", 0);
	}
}

And the trigger for it

Pad1()
{
	trigger = getEnt ( "pad1", "targetname" );
	
	while(1)
	{
		trigger waittill ( "trigger", who );
		thread Bouncer(who);
	}
}
0

Share this post


Link to post
Share on other sites

 

Heres a bounce pad script from waterworld, it works for me but, I don't know if it's what you're looking for?

What you've posted is a bounce, done the same way as in my mod, but with exception that your code can let people glitch health, screen becomes red and strength is hardcoded so please don't post something that's worse in every aspect if a function that does the thing right is in mod.

All God wanted to know is how to control bounce power, that's it, no need to spam with more codes.

0

Share this post


Link to post
Share on other sites

What you've posted is a bounce, done the same way as in my mod, but with exception that your code can let people glitch health, screen becomes red and strength is hardcoded so please don't post something that's worse in every aspect if a function that does the thing right is in mod.

All God wanted to know is how to control bounce power, that's it, no need to spam with more codes.

 

I'm sorry, I didn't know :okay: 

0

Share this post


Link to post
Share on other sites
player braxi\_common::bounce( <(vec3)direction of where the 'kick' comes from> ), <(int) strength> );

Example where player is bounced verticaly:

player braxi\_common::bounce( vectorNormalize( player.origin - (player.origin - (0,0,1)) ), 500 );

 

Thank you, tried it with those settings, and it gave me a little bounce, but it seems while sliding, bouncing is... futile till now. For my bounce to make a difference do I have to change the strength or the Z unit can also make a difference?

 

 

Can I ask you, for example, if I want to bounce a player from a platform to another, like in this pic:

 

Player steps on purple area, and get's bounced off to the yellow area behind him

M3yu8zY.png

 

Will I need to use a target or something like that?

 

 

Sorry for many questions, I never worked with this function before :okay:

0

Share this post


Link to post
Share on other sites

You can use the script I mentioned for things like that, I used it in a map were the player had to bounce over a gap, you just make a trigger multiple and give it a targetname and add the scripts that I gave, I mean, It works fine for me and just change the strength to what you like, It's better than pads with origins tbh 

 

820466ef56fd8a35bbe2059bfdb2d1fb.png

 

^ simple as that 

 

if that was what you meant as i didn't really understand it 

0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0