dim3 Forum

Full Version: Slippery surfaces and sliding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How can I make slippery surfaces like ice?
I don't know the API and can't find it in the docs, Brian will have to tell you that. Anyway, you set the ice texture to a material by double clicking it in the texture window, and typing in the material part. Then, you script the player to check what he's standing on every second or so and when its ice you change the speed settings to slip (like the audiTT does) Wink.

Brian, what IS the API for that? Is it in the docs??
I hope there is simple solution for this Smile And I wonder if it's possible to make objects (rails, benches) slippery since I'll probably start making a snowboarding game next weekend and that would be part of the grinding/sliding system.
Oh don't worry, it's actually really simple. If I could get the API I could tell you exactly how to do it....

For models, you can use the touch event.
See that at the bottom of the script:
Quote:function event(obj,mainEvent,subEvent,id,tick)
{
switch (mainEvent) {

case DIM3_EVENT_CONSTRUCT:
playerConstruct(obj);
return;


case DIM3_EVENT_MAP:
playerMapChange(obj,subEvent);
return;

case DIM3_EVENT_SPAWN:
playerSpawn(obj);
return;

case DIM3_EVENT_LIQUID:
playerLiquid(obj);
return;

case DIM3_EVENT_ANIMATION_OBJECT:
playerAnimation(obj,subEvent);
return;

case DIM3_EVENT_DAMAGE:
playerDamage(obj);
return;

case DIM3_EVENT_HEALTH:
playerHealthDraw(obj);
return;

case DIM3_EVENT_DIE:
playerDie(obj);
return;

case DIM3_EVENT_WEAPON_SELECT:
redrawWeaponDisplay(obj);
return;

case DIM3_EVENT_WEAPON_FIRE:
playerFire(obj);
redrawWeaponDisplay(obj);
return;

case DIM3_EVENT_MESSAGE:
playerMessage(obj,subEvent,id);
return;

case DIM3_EVENT_TIMER:
playerTimer(obj,id);
return;

case DIM3_EVENT_STATE:
playerState(obj,subEvent);
return;

case DIM3_EVENT_PICKUP:
playerItemPickup(obj);
return;

}
}
add
Code:
case DIM3_EVENT_TOUCH:
     playerTouch(obj);
     return;
and then make a player touch function, and make change the player settings to be slippery if it touches something. (or only if it touches a bench....)
WAIT
If you want EVERYTHING slippery that REALLY REALLY easy! Just change
Code:
    obj.turnSpeed.facingWalk=5;
    obj.turnSpeed.motionWalk=5;
    obj.turnSpeed.facingRun=5.2;
    obj.turnSpeed.motionRun=5.2;
    obj.turnSpeed.facingCrawl=4;
    obj.turnSpeed.motionCrawl=4;
    obj.turnSpeed.facingAir=4;
    obj.turnSpeed.motionAir=4;
    
    obj.forwardSpeed.walk=96;
    obj.forwardSpeed.run=156;
    obj.forwardSpeed.crawl=51;
    obj.forwardSpeed.air=81;
    obj.forwardSpeed.acceleration=5;
    obj.forwardSpeed.deceleration=9;
    obj.forwardSpeed.accelerationAir=2.0;
    obj.forwardSpeed.decelerationAir=1.5;
in the player.js script. Search the forum for "CAR PHYSICS". I know your not talking cars, but people were discussing how to make cars slip less/more. Change the speed settings to slip more.


If you need more help just be more specific, should everything be slippery, just ice, objects....
Umm doesn't that make the player slide on the ground if I collide to the rail? That's not really what i want :P
[EDIT] And the things I want to be slippery are benches and rails. And maybe random icy spots on the ground Smile[/EDIT]
The API is obj.status.floorTag(); ...I think. :/
[EDIT]I found a better way to do it (and deleted the old part of this post)! Bink's right with the API, I expected it to say material so when I searched it nothing came up....
Anyway, just make a transparent floor ontop of the rail and when you hit that you slide Wink.
Or just use segments to build the rail. That would be easier. Smile
The question is, how do you get the player to stay on the rail as he's sliding on it. Node system maybe? That would require a lot of work. Maybe invisible walls on the side of the rail, that kept you from sliding off, thus having to : (jump off the rail)(jump out of the walls).
Gordon CSA Wrote:The question is, how do you get the player to stay on the rail as he's sliding on it. Node system maybe? That would require a lot of work. Maybe invisible walls on the side of the rail, that kept you from sliding off, thus having to : (jump off the rail)(jump out of the walls).
Turn of sidesteps and set the turn speed to zero.
If the player jumps or lands, turn sidestepping on again and reset the turn speed. Smile
Now if it's a curved rail, that would be a problem. :/
Pages: 1 2
Reference URL's