Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
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
3 registered members (AndrewAMD, TipmyPip, ozgur), 860 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple entity properties crash #445475
09/10/14 22:19
09/10/14 22:19
Joined: Aug 2014
Posts: 57
Y
Yking Offline OP
Junior Member
Yking  Offline OP
Junior Member
Y

Joined: Aug 2014
Posts: 57
Hello everyone,

I seem to have a minor problem with SED, maybe I just sat too long in front of my Screen but I absolutely do not know, why I get a "Crash in Main" Alert Window everytime I run this simple code.


Quote:
#include <acknex.h>
#include <default.c>

#define Lifepoints skill1

ENTITY* Player; //Public Entity

function main()
{
Player.Lifepoints = 10;
}


I defined skill1 as Lifepoints so its easier to program with, it does not matter if I use Player.skill1 (that does not work either).
I created the Entity* Player before my Main-Code so its accessible from everywhere, placing it in the Main also does not work (Still getting a crash).

I must overlook something obvious but I dont know what shocked ,
is there someone who can help me? It would be very appreciated laugh !

Re: Simple entity properties crash [Re: Yking] #445476
09/10/14 22:59
09/10/14 22:59
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
1. your entity-pointer is empty (there's no entity it points to). you have to create an entity first. (I guess you'll need some more knowledge about what pointers do, how they work, etc.)
2. there already exists a pointer 'player' (no capital 'p'), you can use that


POTATO-MAN saves the day! - Random
Re: Simple entity properties crash [Re: Kartoffel] #445481
09/11/14 06:30
09/11/14 06:30
Joined: Jul 2014
Posts: 49
Romania,vaslui
A
AceX Offline
Newbie
AceX  Offline
Newbie
A

Joined: Jul 2014
Posts: 49
Romania,vaslui
You need to read the whole manual to understand how this engine works,and how to do a game.

And this is the code:

Code:
#include <acknex.h>
#include <default.c>

#define Lifepoints skill1

function main()
{
player = ent_create("your_player_model.mdl",vector(0,0,0),NULL);

player.Lifepoints = 10;
}



}

Re: Simple entity properties crash [Re: AceX] #445486
09/11/14 08:07
09/11/14 08:07
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
@^: you don't have to read the whole manual in order to understand it. The workshops are a better place to start.

also your example won't work because there's no level loaded. Besides that theres also nullvector which you can use instead of vector(0, 0, 0).


POTATO-MAN saves the day! - Random
Re: Simple entity properties crash [Re: Kartoffel] #445487
09/11/14 08:55
09/11/14 08:55
Joined: Jul 2014
Posts: 49
Romania,vaslui
A
AceX Offline
Newbie
AceX  Offline
Newbie
A

Joined: Jul 2014
Posts: 49
Romania,vaslui
Yeah,workshops is a better solution laugh

And my example show what he need .I think he already know some basics wink

Re: Simple entity properties crash [Re: Yking] #445496
09/11/14 14:01
09/11/14 14:01
Joined: Aug 2014
Posts: 57
Y
Yking Offline OP
Junior Member
Yking  Offline OP
Junior Member
Y

Joined: Aug 2014
Posts: 57
Thanks for all the help grin !!
I feel like an idiot now ^^


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