Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, 7th_zorro, AndrewAMD), 1,057 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
Page 1 of 2 1 2
How to set BBOX & copy/paste level files? #426311
07/19/13 19:40
07/19/13 19:40
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
Hi, guys

My problem is as follows:

first, a level is loaded and nothing weird happens. But, it all comes when I load a new level. The engine crashes and stops working when I load that level

Be aware that:

1) This happens with a particular level and NOT when any new level is loaded

2) The new level (which makes the problem) is semi-identical to the level existing just before that level




I would be grateful if anyone could tell me what the problem can be


The problem is solved. Now, I'm gonna change the subject.....

I've two questions:

The first q.:
How can I change the size of the bounding box? Don't laugh!...'cause I change the min_x,max_x values ,but nothing happens and the bounding box keeps its default size!!


The second q.: How to copy/paste level files? Which files should I copy/paste and which parameters in WED should I change? As I tried many times to copy/paste level files from a folder to another ,but the copy is different from the original file (some textures are missing...etc.)

e.g. If I have a level .wmp file called "house1.wmp" ,I copy/paste ALL files named "house1" (compiled .wmb map, .bak file....etc.) ,but the problem still exists


Thank you for reading......

Last edited by The_KING; 07/25/13 13:27.
Re: The engine crashes when a level is loaded [Re: The_KING] #426313
07/19/13 20:21
07/19/13 20:21
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline
Member
CanadianDavid  Offline
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
Looks okay to me. Can you try to load just the compiled level (.WMB) file without the script to see if you can actually load it?

If you can, it may suggest a script error. Try adding a wait(3); right after you level_load("level2_ch1m2.wmb"); statement. We may have to see more of your code and/or a fully working example of your problem.

Another possible problem I can see is that you may be trying to remove an entity that does not exist or has already been removed (ent_remove(clara);). Or worse, you may be removing the entity "clara" and later on in your program you are trying to access/modify the "clara" pointer which actually does not exist anymore! I'm not too sure how this code fits into your complete code but you may want to watch out for that!

Re: The engine crashes when a level is loaded [Re: CanadianDavid] #426325
07/20/13 19:17
07/20/13 19:17
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
How can I call a function before its definition? Or in other meaning, if we have two functions A and B ,and fucntion A calls B ,then function A calls B. How to do this without errors ,if possible?

I wanted to know that 'cause this is gonna help me a lot

Re: The engine crashes when a level is loaded [Re: The_KING] #426326
07/20/13 20:16
07/20/13 20:16
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
If I understood you correctly use function prototypes:

void init_menu();

void init_game()
{
init_menu();
...
}

Then define the content of the init_menu declaration later as if you would have never used such a prototype, so:

void init_menu()
{
...
}

The parameters and the return type have to match, thus the prototyp to

var ent_get_dist(ENTITY* ent, VECTOR* vtarget) {...}

is

var ent_get_dist(ENTITY*, VECTOR*);


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: The engine crashes when a level is loaded [Re: Superku] #426354
07/21/13 20:23
07/21/13 20:23
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
OK. One more question.

If I loaded a level ,then created an entity using "ent_animate". After that, I loaded another level ,will the entity still exist?

'cause I create my player model in the script after loading the level ,then when I load another level ,I don't see the player (also I don't see the sky which was created in the script too). Will it be better if I put the player in the level in WED?

Re: The engine crashes when a level is loaded [Re: The_KING] #426356
07/21/13 20:41
07/21/13 20:41
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
i guess you meant ent_create.
And the answer is no, all entites will be cleared on level load and only the ones placed in wed will be created. Rather than putting it on wed i guess it's better to have function like setup_level(levelname) which loads the level, creates the player and skybox and any other variables/entities you might need.


3333333333
Re: The engine crashes when a level is loaded [Re: Quad] #426358
07/21/13 20:49
07/21/13 20:49

M
Malice
Unregistered
Malice
Unregistered
M



@Quad - if he doesn't set his pointer player1 to null before loading the new level will it be invalid? set to null, load level, set player1 = me; in player function - Right?


Edited pointer name

Last edited by Malice; 07/21/13 20:50.
Re: The engine crashes when a level is loaded [Re: ] #426368
07/22/13 10:08
07/22/13 10:08
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline
Member
CanadianDavid  Offline
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
Normally I think they're automatically removed but it looks like The_KING is using the global pointer, "clara," in his code and therefore he would have to set it to NULL afterwards or re-assign it on ent_create().

Re: The engine crashes when a level is loaded [Re: CanadianDavid] #426498
07/23/13 19:45
07/23/13 19:45
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
***THE PROBLEM IS SOLVED***

But I still have other problems ,look at the thread above

Re: The engine crashes when a level is loaded [Re: The_KING] #426499
07/23/13 20:11
07/23/13 20:11
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
to set the bounding box , first set both FAT and NARROW flags of the entity. http://www.conitec.net/beta/aentity-fat.htm

or as mentioned on the manual page, c_setminmx or c_updatehull do it too, but they also change the bounding box size.


Free world editor for 3D Gamestudio: MapBuilder Editor
Page 1 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