Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (EternallyCurious, howardR), 646 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
make entity remove after reaching end path :) #454141
08/29/15 22:39
08/29/15 22:39
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
this is what i use now :

Code:
action moveontrack_01()
{
	var walk_percentage;
	var walking_speed = 0.3;
	VECTOR last_pos[3];
	VECTOR direction[3];
	var distance = 0;
	var dist_to_node;

	var current_node = 1;
	
	set(my,SHADOW|PASSABLE);
	path_set(me, "path_000"); 
	while(1) 
	{
		ent_animate(my, "run", walk_percentage, ANM_CYCLE); // play the "walk" animation
		walk_percentage += 6 * time_step; // "3" controls the animation speed
		path_spline(me, my.x, distance);
		distance += walking_speed ;
		vec_diff(direction, my.x, last_pos);
		vec_to_angle(my.pan, direction);
		vec_set(last_pos, my.x);


		wait(1);

	}

now it keeps cycling :) how to remove it when it comes to the last point of the path ? :)

thx for your time and help :)


}



Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: make entity remove after reaching end path :) [Re: Realspawn] #454143
08/29/15 23:18
08/29/15 23:18
Joined: Mar 2015
Posts: 23
Frankfurt
JcI_the_second Offline
Newbie
JcI_the_second  Offline
Newbie

Joined: Mar 2015
Posts: 23
Frankfurt
You can put one entity on end of the path, and when your moving entity get close to this point then remove your moveontrack entity
if(vec_dist(my.x,flag_ent.x) < 50){ ent_remove(me);}

Re: make entity remove after reaching end path :) [Re: JcI_the_second] #454144
08/29/15 23:22
08/29/15 23:22
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
I was thinking in that way like making it react on a model near the end point laugh

i will give it a shot thank you laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: make entity remove after reaching end path :) [Re: Realspawn] #454145
08/29/15 23:39
08/29/15 23:39

M
Malice
Unregistered
Malice
Unregistered
M



Code:
action car(){

	track_select=random(2);; // GLOBlE NOTICE
	//if(track_select >2)
	//track_select = 1;
	if(integer( track_select) ==0)
	path_set(my,"path_000");
	if(integer( track_select) ==1)
	path_set(my,"path_001");
	
	/////////////////////////////////////////////////////////////////////
	
	my.NODE_NEXT=path_nextnode(my,1,1); // SET THE NODE
	while(1)
	{
         // PATH NODE DETECTION AND RANDOMIZATION AND FACING //////////////////////////////////
		
		
		if(vec_dist(my.x,vec_next_node.x) < my.max_x)    
		{
                  // HERE you have to adjust the code REALSPAWN
                  if(my.NEXT_NODE == 10) // replace 10 with the number for the last node, inside the cheese
                   ent_remove(me);
   
			//path_next(my); // will jump from current path to new path// Jump to new path
			my.NODE_NEXT=path_nextnode(my,my.NODE_NEXT,1); // Grab Next node on new path -- NOTE ALL PATHS MUST HAVE THE SAME NUM NODE IN SAME GEN LOCATION
			
		}
		
		path_getnode(my,my.NODE_NEXT,vec_next_node,NULL);  // Get next node actual vector location 
		
		
			vec_to_angle(my.pan,vec_diff(NULL,vec_next_node,my.x)); // face the new node
		

		///////////////////////////////////////////////////////////////////////////
		
		// SOFT AND HARD MOVEMENTs /////////////////////////////////////////////////////////////
		
		c_move(my,vector(my.skill3*time_step,0,0),nullvector,GLIDE | IGNORE_PASSABLE);
		
wait(1);
}
}



test and play with this. This does seem to work but the ent_remove will cause a crash.


Last edited by Malice; 08/29/15 23:42.
Re: make entity remove after reaching end path :) [Re: ] #454147
08/29/15 23:47
08/29/15 23:47
Joined: Mar 2015
Posts: 23
Frankfurt
JcI_the_second Offline
Newbie
JcI_the_second  Offline
Newbie

Joined: Mar 2015
Posts: 23
Frankfurt
Originally Posted By: Malice
test and play with this. This does seem to work but the ent_remove will cause a crash.

not if we put 'return' after 'ent_remove' wink

Re: make entity remove after reaching end path :) [Re: JcI_the_second] #454148
08/29/15 23:52
08/29/15 23:52

M
Malice
Unregistered
Malice
Unregistered
M



you are correct or move the ent_remove out the loop.
I was just telling spawn because he knows i uninstalled 3dgs and would not be testing this when he ask me to make the hacks

Re: make entity remove after reaching end path :) [Re: ] #454150
08/30/15 01:54
08/30/15 01:54
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
I used a simple object that removes the rat laugh
no crashes anymore fixed it all. I will soon upload the demo.


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain

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