Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Rotating Doors - Where am I wrong? #419973
03/17/13 23:35
03/17/13 23:35
Joined: Jan 2013
Posts: 63
Loremaster Offline OP
Junior Member
Loremaster  Offline OP
Junior Member

Joined: Jan 2013
Posts: 63
Where am I wrong: In the Shooter-Template there is a relatively large function to revolve doors using pan-values and angle-calcualtions. I thing this is very complicated. To use a swinging door, I create a model that swings open and use the following limerick to open it.

Code:
action ThingAnimates () {
while(1) 
   {
      my.skill1 += 3*time_step;
      if (my.skill1 > 100) my.skill1 -= 100; 
      ent_animate(me,"Open",my.skill1,ANM_CYCLE);
      c_updatehull(my,1);
      wait(1);
   }
}



c_updatehullk makes sure the ColDet stays precise. The BB works, I've checked using the f11-key. It's a breeze and I have made it, therefore I am VERY suspicious. Is there anything wrong with that approach?

Re: Rotating Doors - Where am I wrong? [Re: Loremaster] #419974
03/17/13 23:52
03/17/13 23:52
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Why do you need:
Code:
if (my.skill1 > 100) my.skill1 -= 100;

Using "ANM_CYCLE" will already make it cycle from 0 to 100 and then from 0 again.

I would do it this way:
Code:
action actDoor(){
	// reset skill for animation:
	my.skill1 = 0;
	// animation loop:
	while(my.skill1 < 100){
		// animations speed:
		my.skill1 += 3 * time_step;
		// animate the door:
		ent_animate(my, "frame", my.skill1, ANM_CYCLE);
		// wait one frame:
		wait(1);
	}
	// as we've played the animation, fix the bounding box:
	c_updatehull(my, 10); // insert the last animation frame, instead of 10
}

BTW, I don't really think, that rotation the PAN angle of door, without any collusions is really slow or so laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1