Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,618 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help! #178380
01/17/08 21:20
01/17/08 21:20
Joined: Jan 2007
Posts: 59
C
Creepinbox Offline OP
Junior Member
Creepinbox  Offline OP
Junior Member
C

Joined: Jan 2007
Posts: 59
Okay, I need help .. again .. This time i have no IDEA what could be wrong ..

So I'm Playing around with defines right ? and I have this line
you = c_trace (target.x, target.x, IGNORE_ME);
if(you){beep(); you.HEALTH -= 5;} this should point to my enemy.. or anything I have in mind or am pointing at.. so the enemy code doesn't matter I still get the same Error. That Error reads like this:

"acknex.exe has encountered a problem and needs to close. We are sorry for the inconvenience." And then you get that send don't send stuff right..

Well this wasn't too weird It's been know to happen when I Make a while loop without the Wait(1); at the end..

But then I knew what the problem was after a quick overlook .. now .. It can be anything.. so I need some help... If anyone's got a clue please post

Last edited by Creepinbox; 01/17/08 21:21.
Re: Help! [Re: Creepinbox] #178381
01/17/08 21:33
01/17/08 21:33

A
Anonymous
Unregistered
Anonymous
Unregistered
A



c_trace returns a distance, not a pointer.
"you" is set automatically to the hit entity. (if any)

(besides: c_trace(target.x, target.x, IGNORE_ME) traces just one quant (if target is defined))


c_trace(my.x, target.x, IGNORE_ME); // if target is a defined (and not nonsens)
if(you){....}

Re: Help! [Re: ] #178382
01/17/08 22:07
01/17/08 22:07
Joined: Jan 2007
Posts: 59
C
Creepinbox Offline OP
Junior Member
Creepinbox  Offline OP
Junior Member
C

Joined: Jan 2007
Posts: 59
Well .. I don't really know what you are talking about.. but I can writte if(key_o){beep(); you.HEALTH -= 5;} And it will still fail -- but thanks for you post..

Re: Help! [Re: Creepinbox] #178383
01/18/08 00:34
01/18/08 00:34
Joined: Dec 2006
Posts: 78
Nevada, USA
Futurulus Offline
Junior Member
Futurulus  Offline
Junior Member

Joined: Dec 2006
Posts: 78
Nevada, USA
mercuryus is right about that. Imagine c_trace this way: you're aiming a gun at an enemy (c_trace(gun.x, enemy.x, options)). The function will return the distance to the enemy. you will automatically be set to the enemy, and target will automatically be set to the place where the enemy was hit.

What your code does is assign the distance returned, for example, 3 quants, to "you." "You" is now a pointer pointing to memory location 3, so when you try to write a number to one of "you"'s skills, you are trying to assign a value to a really low position in memory, one of the things Windows programs are Not Allowed to Do. As a result, Windows shuts down A7 with that ugly error message.

Long story short, your code should look like this:
Code:
c_trace(target.x, target.x, IGNORE_ME);
// mercuryus is also right here too, by the way: tracing from "target" to "target"
// won't usually hit anything. Imagine trying to aim a gun at the gun itself.

if(you) // you is automatically set for you. Isn't that nice?
{
beep();
you.HEALTH -= 5;
}


Hope I've helped explain it!


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

Gamestudio download | 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