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
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 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
E1513 Crash maybe bug? verry curious #293953
10/15/09 05:06
10/15/09 05:06
Joined: Oct 2009
Posts: 14
U
uniquy Offline OP
Newbie
uniquy  Offline OP
Newbie
U

Joined: Oct 2009
Posts: 14
Hi, sitting on this for 3 hours... and i realy think, that it only can be a BUG.

In this minimalistic code, you can see 2 "BAD" lines.
If one of it is removed, the code work.
Otherwise, together, i get:

Code:
E1513 Crash in ModelAdded



But whats realy crazy: If i set the ModelAdded function to just 1 parameter (ENTITY* ent_added), it works fine too.

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

ENTITY* ent;

void ModelAdded(ENTITY* ent_added, STRING* var_val){
	FONT* font1 = "Arial#18b";
	VECTOR* tmp;
	VECTOR* tmp2;
	
	vec_set(tmp.y, tmp2.y); // BAD LINE 1
	
	TEXT* txt = txt_create(1,1); // BAD LINE 2
}

void main()
{
	level_load("level.wmb");
	wait(3);
	
	ent = ent_create("cube.mdl",vector(0,0,0),NULL);
	ModelAdded(ent,"test");
}



Last edited by uniquy; 10/15/09 05:14.
Re: E1513 Crash maybe bug? verry curious [Re: uniquy] #293954
10/15/09 05:20
10/15/09 05:20
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey

actual bad lines are this three;

FONT* font1 = "Arial#18b";
VECTOR* tmp;
VECTOR* tmp2;

on runtime you have to create fonts with font_create,
FONT* font1 = font_create("Arial#18b");

and then, tmp and tmp2 are just VECTOR pointers and not VECTORs and they are currently pointing to nothing, if you try to use them youll get a crash.
so change this lines:
VECTOR* tmp;
VECTOR* tmp2;
with:
VECTOR tmp;
VECTOR tmp2;

---

and before sitting in front of it 3 hours, and thinking it can only be a bug, check the manual.


3333333333
Re: E1513 Crash maybe bug? verry curious [Re: Quad] #293956
10/15/09 05:34
10/15/09 05:34
Joined: Oct 2009
Posts: 14
U
uniquy Offline OP
Newbie
uniquy  Offline OP
Newbie
U

Joined: Oct 2009
Posts: 14
oh sh.. im sorry! checked the manual many times, and searched here, but... ouph, could be eek im a noob o.O

But realy thanks!

Re: E1513 Crash maybe bug? verry curious [Re: uniquy] #307445
01/29/10 12:50
01/29/10 12:50
Joined: Jan 2008
Posts: 11
A
AloC83 Offline
Newbie
AloC83  Offline
Newbie
A

Joined: Jan 2008
Posts: 11
here's another noob who spent 3 hours trying to solve this problem!

fellow noobs, beware of the difference between VECTOR and VECTOR* (between any pair of data type and pointers to that data type for that matter)

Re: E1513 Crash maybe bug? verry curious [Re: AloC83] #307496
01/29/10 17:16
01/29/10 17:16
Joined: Apr 2009
Posts: 4
A
archie Offline
Guest
archie  Offline
Guest
A

Joined: Apr 2009
Posts: 4
At the very least, there was a "hint" in the Gamestudio Wiki under Scripts\Basic Hints "VECTOR Declaration" but probably that alone is not enough to completely remove such "growing pains".

Re: E1513 Crash maybe bug? verry curious [Re: archie] #307515
01/29/10 19:33
01/29/10 19:33
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

Also look for

Programming Trouble: FAQ

in manual wink


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C

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