Jump to content
HonzaVinCZ

[Need your help] Understanding variables

Recommended Posts

No need for creating missionNamespace(Global) variables for the craters, just pass them into the spawned code.

[ _crater, _crater1, _crater2 ] spawn {
	{
		_x hideObjectGlobal false;
	}forEach _this;
	
	sleep 60;
	
	{
		deleteVehicle _x;
	}forEach _this;
};

 

As for the crater mark not removing, it seems fine testing from debug console in Eden preview...

_h = [] spawn {
	_crater = "Crater" createVehicle ( player getPos[ 5, getDir player ] );
	sleep 10;
	deleteVehicle _crater;
};

Only thing that remains is the result of the grass cutter initiated by the crater object.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
7 minutes ago, HonzaVinCZ said:

Hm, it doesn't detect the crater mark created by the explosion. It detects craters placed by the script but for some reason it can't detect crater mark created by the explosion itself. Tested it with hint.

 

Then the craters class is something else than "crater". you might get the crater class figured out by leaving the class name out from nearestObjects

  • Like 2

Share this post


Link to post
Share on other sites
46 minutes ago, Larrow said:

No need for creating missionNamespace(Global) variables for the craters, just pass them into the spawned code.


[ _crater, _crater1, _crater2 ] spawn {
	{
		_x hideObjectGlobal false;
	}forEach _this;
	
	sleep 60;
	
	{
		deleteVehicle _x;
	}forEach _this;
};

 

As for the crater mark not removing, it seems fine testing from debug console in Eden preview...


_h = [] spawn {
	_crater = "Crater" createVehicle ( player getPos[ 5, getDir player ] );
	sleep 10;
	deleteVehicle _crater;
};

Only thing that remains is the result of the grass cutter initiated by the crater object.

Oh, that is cool and works perfectly, thank you!
Btw the crater I create can be deleted but it won't delete the explosion crater mark, described below my thought

 

 

32 minutes ago, gc8 said:

 

Then the craters class is something else than "crater". you might get the crater class figured out by leaving the class name out from nearestObjects

hint shows it's "krater.p3d" which is basically "Crater" but if I want to delete it, it just won't delete. Maybe it needs little delay beacause the crater don't get created that quick as the script runs. I left it without creating my own crater and left there the one which is created by the explosion itself, I'll try to code to remove at least that one.  

Thank you both for your help, I couldn't continue my code without your help!

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, HonzaVinCZ said:

hint shows it's "krater.p3d" which is basically "Crater"

 

yes but nearestObjects can filter only by class names not by the object name which is the "krater.p3d". Now if someone could just tell how to get that class name 

  • Like 2

Share this post


Link to post
Share on other sites
59 minutes ago, HonzaVinCZ said:

Btw the crater I create can be deleted but it won't delete the explosion crater mark

Sorry miss understood your post.

 

You can hide them...( test from debug console in preview )

h = [] spawn {
	player allowDamage false;
	_pos = player getPos[ 10, getDir player ];
	_bomb = "Bo_GBU12_LGB" createVehicle _pos;
	waitUntil{ isNull _bomb };
	_craters = _pos nearObjects [ "#crater", 5 ];
	{ _x hideObjectGlobal true }forEach _craters;
};

...remember hideObjectGlobal must be done from the server.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
On 10/16/2020 at 2:59 PM, Larrow said:

Sorry miss understood your post.

 

You can hide them...( test from debug console in preview )


h = [] spawn {
	player allowDamage false;
	_pos = player getPos[ 10, getDir player ];
	_bomb = "Bo_GBU12_LGB" createVehicle _pos;
	waitUntil{ isNull _bomb };
	_craters = _pos nearObjects [ "#crater", 5 ];
	{ _x hideObjectGlobal true }forEach _craters;
};

...remember hideObjectGlobal must be done from the server.

No problem!

Oh nice, but also I guess from your reply these explosion made craters can't be deleted individually or? 
Btw sorry for late reply, I was busy during this week.

Share this post


Link to post
Share on other sites
22 hours ago, HonzaVinCZ said:

I guess from your reply these explosion made craters can't be deleted individually

I could not get them to delete not from the few quick test I did.

I was wondering if they are maybe a particle shape but not seeing anything from the ammo classes defined particles to suggest this.

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×