turn 180 º
turn 180 º
i need a simple script for turn 180º the player
			
													
					Last edited by doomero on Thu Nov 29, 2012 6:24 pm, edited 1 time in total.
									
			
									
						- 
				Watermelon
 - Zandrone
 - Posts: 1244
 - Joined: Thu Jun 28, 2012 9:07 pm
 - Location: Rwanda
 
RE: turn 180 º
Two ways of doing it:
1) Have a clientside script do the turn 180 command
2) Get actor angle, add 0.5... you may need to subtract 1.0 if its greater than 1.0 and the engine doesn't handle it right.
			
									
									
						1) Have a clientside script do the turn 180 command
2) Get actor angle, add 0.5... you may need to subtract 1.0 if its greater than 1.0 and the engine doesn't handle it right.
RE: turn 180 º
http://zdoom.org/wiki/GetActorAngle
http://zdoom.org/wiki/SetActorAngle
Didn't test, but try something like assuming you've assigned TIDs to players somehow.
EDIT: Ninja'd. :V
			
													http://zdoom.org/wiki/SetActorAngle
Didn't test, but try something like
Code: Select all
script 123 (void) {
  SetActorAngle(ActivatorTID(), GetActorAngle(ActivatorTID()) + 0.5);
}EDIT: Ninja'd. :V
					Last edited by Qent on Thu Nov 29, 2012 7:04 pm, edited 1 time in total.
									
			
									
						RE: turn 180 º
yes, i used that script and works good thanks =)
			
									
									
						RE: turn 180 º
You could even smooth it out across several calls of that function and make it look RE-style. Which is what I assume you're going to use it for. :P
			
									
									Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

						Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

- 
				Ijon Tichy
 - Frequent Poster Miles card holder
 - Posts: 901
 - Joined: Mon Jun 04, 2012 5:07 am
 
RE: turn 180 º
Well I have a little script that, when run on a player, will smoothly turn them x amount of degrees. You can also specify which way it goes, and the factor argument controls how fast the turning happens. Higher values slow it down.
edit: you might want to #define PARKMORE_TURN or change the PARKMORE_TURN to a script number
			
													Code: Select all
script PARKMORE_TURN (int degrees, int factor, int direction) net clientside
{
    if (degrees < 0)
    {
        degrees *= -1;
        direction = cond(direction == CLOCKWISE, COUNTERCLOCKWISE, CLOCKWISE);
    }
    
    factor = cond(factor, factor, 4);
    int prevDegrees, addDegrees, curAngle;
    int curDegrees = 0;
    int floatDegrees = itof(degrees);
    int dirMult = cond(direction == CLOCKWISE, -1, 1);
    while (curDegrees < (floatDegrees - 0.1))
    {
        prevDegrees = curDegrees;
        addDegrees = (floatDegrees - curDegrees) / factor;
        curDegrees += addDegrees;
        SetActorAngle(0, GetActorAngle(0) + ((addDegrees * dirMult) / 360));
        Delay(1);
    }
    addDegrees = floatDegrees - curDegrees;
    SetActorAngle(0, GetActorAngle(0) + ((addDegrees * dirMult) / 360));
}
					Last edited by Ijon Tichy on Sat Dec 01, 2012 5:02 pm, edited 1 time in total.
									
			
									
						RE: turn 180 º
this could work on multiplayer?Ijon Tichy wrote: Well I have a little script that, when run on a player, will smoothly turn them x amount of degrees. You can also specify which way it goes, and the factor argument controls how fast the turning happens. Higher values slow it down.
edit: you might want to #define PARKMORE_TURN or change the PARKMORE_TURN to a script numberCode: Select all
script PARKMORE_TURN (int degrees, int factor, int direction) net clientside { if (degrees < 0) { degrees *= -1; direction = cond(direction == CLOCKWISE, COUNTERCLOCKWISE, CLOCKWISE); } factor = cond(factor, factor, 4); int prevDegrees, addDegrees, curAngle; int curDegrees = 0; int floatDegrees = itof(degrees); int dirMult = cond(direction == CLOCKWISE, -1, 1); while (curDegrees < (floatDegrees - 0.1)) { prevDegrees = curDegrees; addDegrees = (floatDegrees - curDegrees) / factor; curDegrees += addDegrees; SetActorAngle(0, GetActorAngle(0) + ((addDegrees * dirMult) / 360)); Delay(1); } addDegrees = floatDegrees - curDegrees; SetActorAngle(0, GetActorAngle(0) + ((addDegrees * dirMult) / 360)); }
- 
				Ijon Tichy
 - Frequent Poster Miles card holder
 - Posts: 901
 - Joined: Mon Jun 04, 2012 5:07 am
 
RE: turn 180 º
It works in Parkmore, at least on players. If you don't need smooth turning, just add 0.5 to the actor's angle as illustrated above.
			
									
									
						RE: turn 180 º
thanks dude i will test this script =)Ijon Tichy wrote: It works in Parkmore, at least on players. If you don't need smooth turning, just add 0.5 to the actor's angle as illustrated above.