Page 1 of 1

[QUESTION][REQUEST]View shake code

PostPosted: Thu Jan 17, 08 8:01 pm
by Tonnochi
Could someone tell me the code to make the view shake (like it does when you destroy a tri-hull weld point on the ship in SP) and could someone give me a bind code for it for the "F" key please.

PostPosted: Thu Jan 17, 08 9:06 pm
by ~SaSQuAtCH~
RTKM_Volcano has that effect, I suggest you to try to find its creator and ask him to tell you the code if there's no other way.

PostPosted: Thu Jan 17, 08 9:38 pm
by Allan
You could look at the mission script for either that boat mission, or mission 15.

PostPosted: Thu Jan 17, 08 9:41 pm
by Tonnochi
Come on, this is a request for it, not how to do it.

Couldn't find it there anyway.

PostPosted: Thu Jan 17, 08 10:44 pm
by Cozmo
I think they were just EarthquakeTriggers in volcano. :?

PostPosted: Fri Jan 18, 08 8:14 pm
by Kaiden
Stop just thinking cause it has Request tag people are gonna drop what they're doing and do it - People make suggestions and you try and do it yourself. :roll:

PostPosted: Fri Jan 18, 08 8:47 pm
by Tonnochi
¤[ß2S]¤Cozmo wrote:I think they were just EarthquakeTriggers in volcano. :?


Is it actually possible to summon triggers?

PostPosted: Fri Jan 18, 08 9:05 pm
by Cozmo
[FGS]Zeitgeist wrote:
¤[ß2S]¤Cozmo wrote:I think they were just EarthquakeTriggers in volcano. :?


Is it actually possible to summon triggers?


Never tried, but they're still classes so it should work.

Edit: Summon ShakeTrigger

But it'll only shake for one second, so after that.

admin set shaketrigger shaketime #.000000

Or I could just code something for you. :?

Code: Select all
player.ShakeView(shakeTime, shakeRollMagnitude, shakeVertMagnitude);

PostPosted: Fri Jan 18, 08 9:22 pm
by Tonnochi
I found out how, so I will summon a lot in a row.

Still need the bind coding for "F".

PostPosted: Sat Jan 19, 08 12:19 am
by Cozmo
Ok, with the bind this is closest you can get, mutator:

Code: Select all
//============================
// MutatorShake - Cozmo
//============================
Class MutatorShake extends Mutator config(Mutator);

var() float shakeTime;
var() float shakeRollMagnitude;
var() float shakeVertMagnitude;

simulated function PostBeginPlay()
{
   Level.Game.BaseMutator.AddMutator(Self);
}

function Mutate (String S, PlayerPawn Player)
{
   if(mid(S, 0, 5) ~= "shake")
   {
      player.ShakeView(shakeTime, shakeRollMagnitude, shakeVertMagnitude);
   }

   if(mid(S, 0, 9) ~= "shakemore")
   {
      shakeTime+=1;
   }

   if(mid(S, 0, 9) ~= "shakeless")
   {
      shakeTime-=1;
   }
}

defaultproperties
{
}
Not tested*

And in user.ini

F=mutate shake

And there's mutate shakemore and shakeless to alter shaketime. :)

PostPosted: Sat Jan 19, 08 3:11 am
by Tonnochi
Thank you, but I don't know where the hell to put that code.

PostPosted: Sat Jan 19, 08 3:30 am
by Kaiden
http://tack.planetdeusex.gamespy.com/Ho ... kages.html :wink:

Save that Code above as .uc in Notepad.

PostPosted: Sat Jan 19, 08 5:23 am
by Tonnochi
doesn't work. Assigned as exactly mutate shake and it doesn't work :(

PostPosted: Sat Jan 19, 08 4:02 pm
by Kaiden
Here is it compiled, I'm guessing you add EditPackages=Shake, and maybe ServerPackages=Shake, then try in game (After putting file in system folder)

PostPosted: Sat Jan 19, 08 4:18 pm
by Alex
Question, do you want this to work on your server only, or on all?

PostPosted: Sat Jan 19, 08 5:09 pm
by Tonnochi
Singleplayer.

PostPosted: Sat Jan 19, 08 5:15 pm
by Batchy
EditPackages=Shake

PostPosted: Sat Jan 19, 08 5:23 pm
by Tonnochi
I did that.

PostPosted: Sat Jan 19, 08 5:31 pm
by Kaiden
Wouldn't it be like Mutategame.mutate shake or something? Like MM is.

PostPosted: Sat Jan 19, 08 7:55 pm
by ~SaSQuAtCH~
¤[ß2S]¤Cozmo wrote:I think they were just EarthquakeTriggers in volcano. :?


Who cares if the same thing happens? :)

PostPosted: Sat Jan 19, 08 11:23 pm
by Cozmo
Oh I think I know; I didn't declare the shaketime variable in defaultproperties, so it's 0, ie: Not shaking :|

PostPosted: Sun Jan 20, 08 5:43 pm
by Tonnochi
That may have an effect.

PostPosted: Sun Jan 20, 08 10:18 pm
by Cozmo
Ok, updated. Add this to your ini as well as server packages.

ServerActors=ShakeMutator.MutatorShake

I don't know how mutators work in singleplayer, if at all, so if not, I'll code something else.

PostPosted: Fri Aug 27, 10 6:48 pm
by Darma
Sorry for reviving but to make a mutator works in singleplayer, you need to summon the class (ShakeMutator.MutatorShake) in the map or add it in the editor because ServerActors is used to summon them in multiplayer

PostPosted: Fri Aug 27, 10 7:16 pm
by ~DJ~
Alot of people know that already now.. :3

BUT YEAH THANKS

PostPosted: Fri Aug 27, 10 11:35 pm
by Darma
Yeah but because they were asking (*cough 2 years ago) I replyed (*cough* late)