Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (steyr, alibaba), 534 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: If comparison is strange [Re: Liamissimo] #346383
11/05/10 00:49
11/05/10 00:49
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
you don't reset standard to the entities position if the entity has moved probably leading to something being below where the player originally was, and you are tracing from the players position to the players original position, not below it.

in your example afk is the only thing that has a different trace point.

c_trace can solve that for you without using c_content.

Code:
function isfrei()
{
	c_setminmax(me);
	VECTOR standard;
	vec_set(standard,my.x);
//	VECTOR afk;
//	vec_set(afk, vector(my.x - 224,my.y, my.z));
	while(me)
	{
		you = NULL; //clear previous you
		vec_set(standard, vector(my.x, my.y, my.z - 224); //set position to trace to
		c_trace(my.x,standard,IGNORE_MAPS|IGNORE_ME|USE_BOX); 
		if(you)
		{
			squeeze = 1;
		}
		else
		{
			squeeze = 0;
		}
		wait(1);
	}
}



Re: If comparison is strange [Re: Liamissimo] #346386
11/05/10 01:26
11/05/10 01:26
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline
Serious User
Nowherebrain  Offline
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
first see if it hits anything...
if(hit)
then proceed with "you" or check both if(hit && you)...
"else" can be funny sometimes try, as stated before, to use another if statement
like
if(!hit)....or if(!you) you == 0 whatever....just fiddle, but I think it is probably something else messing with it in the code....try using it in
one specific action isolated from other entities....if they are all sharing the same function, they can all be messing it up...


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: If comparison is strange [Re: Liamissimo] #346395
11/05/10 09:42
11/05/10 09:42
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Dude, this was so easy))
Here is the demo:
Download link
Enjoy wink

Edit:
if you don't want to download, here is the script:
Code:
var squeeze = 0;

function isfrei()
{
	c_setminmax(me);
	while(1)
	{
		//trace under models for 100 quants
		c_trace(my.x,vector(my.x,my.y,my.z-100),IGNORE_ME|IGNORE_PASSABLE|USE_BOX);
		if(trace_hit){squeeze = 1;}else{squeeze = 0;}
		wait(1);
	}
}



Last edited by 3run; 11/05/10 10:54.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: If comparison is strange [Re: 3run] #346401
11/05/10 11:50
11/05/10 11:50
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
hey 3run!
this code won't work at all!
i've seen the whole code, so i know a little more
it will be the same problem as before!
this function is called from a action. and this action is assigned to more than one block.
so the last action of the scheduler will define the status squeeze!

so liam should check it otherwise, like from the ball to the other site and not from a block to the ball, because the ball is the player and the code is to check for a player under a block.

Felix


Visit my site: www.masterq32.de
Re: If comparison is strange [Re: MasterQ32] #346402
11/05/10 12:02
11/05/10 12:02
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Sorry, I just tried to help. But I think I didn't get the problem right. Please explain a bit more, will be really great if you explain with a picture. I think if you are going to assign this function for more than one entitie, you need to use define, not var, but as I said, I didn't understand the whole problem yet, so please explain a bit more your problem. I want to help you.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: If comparison is strange [Re: MasterQ32] #346404
11/05/10 12:11
11/05/10 12:11
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Originally Posted By: Richi007
hey 3run!
this code won't work at all!
i've seen the whole code, so i know a little more
it will be the same problem as before!
this function is called from a action. and this action is assigned to more than one block.
so the last action of the scheduler will define the status squeeze!

so liam should check it otherwise, like from the ball to the other site and not from a block to the ball, because the ball is the player and the code is to check for a player under a block.

Felix

Yes, that will be the best solution, having one action do all the checking will be a good practise instead of having lot of action do the same checking. Not just it will run faster(just my opinion though) but it will make sure your program do exactly what they supposed to do.

@3run: try to post the code here instead of having to d/l it, It will save everyone's breath laugh. Just a piece is fine.

Re: If comparison is strange [Re: 3run] #346405
11/05/10 12:13
11/05/10 12:13
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
you should know that all actions, functions and so are listet in a scheduler.
so the functions are called serial and not parallel.
so if you call this function more than one times it will look like this:

1. squeeze = 0
2. squeeze = 0
3. squeeze = 1
4. squeeze = 0
5. squeeze = 1
6. squeeze = 0

so squeeze is 0, but it was 1 some times.
So the function is working as a single function, but not as a multi-called function.
i hope you understand know what i meant.


Visit my site: www.masterq32.de
Re: If comparison is strange [Re: MasterQ32] #346414
11/05/10 13:16
11/05/10 13:16
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
I'm absolutely agree with you bart_the_13th.
Richi007, now I understand what you mean.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: If comparison is strange [Re: 3run] #346416
11/05/10 14:02
11/05/10 14:02
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I think 'sueezing' it back down to just a single function WOULD be best...

But, if becomes too difficult to manage, you could change the code a bit
so that the "isfrei" function only thinks about setting squeeze is it is currently ==0,
but if it is already ==1, then dont even try to do the c_trace.
AND whatever function is "reading" the squeeze variable, have it reset it to zero after each 'read'...

ie
Code:
1. function isfrei checks and leaves "squeeze=0;"
2. function isfrei checks and leaves "squeeze=0;"
3. function isfrei checks and SETS "squeeze=1;"
4. function isfrei no longer even checks
5. function isfrei no longer even checks
6. function isfrei no longer even checks

7. action 'something' uses squeeze then sets "squeeze=0;"

Ya get me?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: If comparison is strange [Re: EvilSOB] #346434
11/05/10 17:52
11/05/10 17:52
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Hey,

nice you all had fun with my problem, I will try EvilSob's solution as It sounds nice, or I will just c_trace from my charakter if something is above him :3

Thanks at all, also at Richi007 for explaining it and to 3run to even make a downloadable script.


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Page 2 of 2 1 2

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