Author Topic: Walk slower?  (Read 1653 times)

When a weapon is equipped, is it possible to make the player walk instead of run? if so, how?

Make another datablock, and use %obj.setDatablock(datablockname); in the onMount

You cant just change the datablock like that. It would cause the Nigrabeast to arise from within.

Code: [Select]
%obj.setDatablock(instance);
%obj.setBodyParts();
%obj.setBodyColors();

I think.

Yes, you do.

(People saying v9: Only the setPlayerDatablock event and Horse+setDatablock() work like this, using the function directly does not update your avatar)

Make another datablock, and use %obj.setDatablock(datablockname); in the onMount
another datablock? how can I make the other datablock make the player walk instead of run?

Change the movement speeds in the datablock.

How? I suck at scripting

Now it says in console when I equip it:

Code: [Select]
Add-Ons/Weapon_myweapon/weapon_myweapon.cs (0): Unknown command setPlayerDatablock.
  Object (7331) Player -> Player -> ShapeBase -> ShapeBase -> GameBase -> SceneObject -> NetObject -> SimObject
« Last Edit: August 23, 2008, 02:00:11 AM by XaMMaX211 »

%obj.setDatablock(), not setPlayerDatablock()

%obj.setDatablock(), not setPlayerDatablock()
lol, i'm a handicap

Ok, now how do I make it so when I unequip a weapon, it goes back the playertype before it changed?

in the onMount function :
Code: [Select]
%obj.firstDB = %obj.getDatablock();
%obj.setDatablock(PlayerSlowDatablock);

in on onUnMount or w/e it's called :
Code: [Select]
%obj.setDatablock(%obj.firstDB);

what should I replace first db with?

You don't. That stores whatever type of player you are now (e.g. No Jet Player), then turns you into the "Slow" player, then when you put the weapon away it restores it.

Won't that cause problems if you have mods that change your datablock or two of these weapons at once. (e.g. I use the Mega Gun which turns me slow, then get shot by the horse ray - I turn to a horse, but at full speed! - when I put the gun away, I turn back into the Standard Player, which is odd.)

A better way might be to have alternate datablocks for:
Slow Jets
Slow No Jets - only create and use if No-Jets, Jump-Jet or Leap-Jet player is on
Slow Fuel Jets - only if Fuel Jet is on
Slow Horse - only if Horse or Horse Ray is enabled (horse ray runs the horse script)
and possibly use No-Jet Player for "Slow Quake Player"?

and check these every time your datablock is changed. (e.g. when the Horse Ray hits and you're set to the horse, the script checks and you're still using the Mega Gun, so firstDB is set to the Horse and you are set to Slow Horse until you put it away)

Eh, I guess, but that would use more datablocks, and it wouldn't work for other playermade datablocks