small request -> max_entities not quit in development version

Posted By: Reconnoiter

small request -> max_entities not quit in development version - 07/27/15 11:33

Hi JCL,

Would be nice if exceeding the number of max_entities would only give an error message and not quit the game in the development version. I want to use max_entities in my map editor and most of the times I use it is in development modus (since its a bit of a continous project for me).

If it has to do with warn_level = 2, I would prefer to keep warn_level to 2 to prevent bugs sneaking in.

(I have v 8.45)

If this would delay other updates/changes/fixes than this post can be ignored. But if it is a quick fix it would be nice to have laugh .


Posted By: jcl

Re: small request -> max_entities no crash in development version - 07/27/15 11:38

There is no reason why exceeding max_entities should cause a crash. Maybe it's a crash in your script, from a failed ent_create and accessing a NULL pointer?
Posted By: Reconnoiter

Re: small request -> max_entities no crash in development version - 07/27/15 13:49

Hi,

Thanks for your quick reply. I get an erro E1340 saying "not enough entities reserved (x)". As soon as I click Ok or click away the message, the game/editor crashes.

This the ent_create code I am now testing it with:
Code:
function button_create_ent(var buttonnumber, PANEL* p_panelofbutton)
{
  ...  
  you = ent_create(select_filename_str, target_pos_vec, new_selection);			
}



The action (new_selection) is not run as it should (checked it with error("test");) so that could not be it. And 'you' is not used in other global function before it is made NULL and e.g. filled with next_next again.

Setting warn_level = 0; also does not help.

But most importantly, I also get the error with a new dummy script. Maybe people could try the code beneath and check if it crashes or not when clicking 'ok':
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////


function main()
{
  vec_set(screen_size,vector(1000,600,0));
  wait(1);
  video_window(NULL, NULL, 4+16+32+64+128, "my game");
  
  vec_set(sky_color,vector(150,90,90)); // dark blue
  vec_fill(sun_color.blue, 225); 
  d3d_antialias = 9;
  shadow_stencil = 3;
  
  max_entities = 1;
  level_load(NULL);

  ent_create(NULL, nullvector, NULL);
  ent_create(NULL, nullvector, NULL);
  
}

Posted By: jcl

Re: small request -> max_entities no crash in development version - 07/27/15 15:13

I get indeed no crash with your code. The error message appears and then the script terminates.

Does anyone get a crash?
Posted By: Superku

Re: small request -> max_entities no crash in development version - 07/27/15 16:38

I don't get a crash either.

@Reconnoiter: What exactly do you mean with "crash", just a simple clean exit or some Windows crash message?

EDIT: @below: Oh I've overlooked that.
Posted By: Wjbender

Re: small request -> max_entities no crash in development version - 07/27/15 16:56

this is what he said

Originally Posted By: Reconnoiter
Hi JCL,
Would be nice if exceeding the number of max_entities would only give an error message and not quit the game in the development version.


so most likely just used a wrong word in the title ,the question as I see was about that and not crashing
Posted By: Reconnoiter

Re: small request -> max_entities no crash in development version - 07/27/15 17:25

Quote:
@Reconnoiter: What exactly do you mean with "crash", just a simple clean exit or some Windows crash message?
, sorry crash is the wrong word, I mean a simple exit.

Quote:
The error message appears and then the script terminates.
, yeah I would like that only an error message appears but not that the script terminates (if it isn't to much asked that is). Exceeding max_entities is not game-breaking right (/creating memory errors etc.)? So I personally think terminating the script is a bit overkill.
Posted By: MasterQ32

Re: small request -> max_entities no crash in development version - 07/28/15 11:26

Can confirm crash:



Code:
Log of A8 Engine 8.45.4 run at Tue Jul 28 11:24:18 2015
Felix on Windows NT/2000/XP version 6.2 Build 9200
Options -nx 200 -diag uhack.c
App: C:\Program Files (x86)\GStudio8\acknex.exe in C:\Users\Felix\Desktop\

MM mixer opened
DSOUND device opened
DI interface opened
Start Window opened(c) Conitec - www.3dgamestudio.com
A8 Engine - Commercial Edition V8.45.4 - Jan 16 2014
Development version
Registered to: Felix Queissner

DI Microsoft PC-joystick driver 5 axes 10 buttons initialized
Mouse found
Joystick found
Lautsprecher (High Definition Audio-Gerät) opened
AMD Radeon R9 200 Series pure T&L device 1ff9 detected
D3D device AMD Radeon R9 200 Series 1ff9 selected.
ackAR.dll opened
acknet.dll opened
ackoal.dll opened
ackphysX.dll opened
ackwii.dll opened
Compiling UHACK.C - [Esc] to abort.......... 0.109 sec
Running UHACK.C.
2 objects
Main started at 1.205
def_startup started
D3D_Init Window: 1000x600 -> Window: 1x1000x600x32
Video memory found: 4091 MB
Main loop at 1.276
LevelInit at 1.278 0 lmaps 0 textures...ok
LevelReady at 1.280
Error E1340: Not enough entities reserved (1)
Program aborted....
Close level,DLL,objects
Free input,funcs,panels,defs,syns,views,strings,vars..ok
Free sounds,bmaps,fonts,hash,defs1,script..ok
Close dx,multimedia,D3D,engine,nexus..ok
A8 Engine - Commercial Edition V8.45.4 - Jan 16 2014
(c) Conitec - www.3dgamestudio.com
Registered to: Felix Queissner
Close window at 1.594

Posted By: jcl

Re: small request -> max_entities no crash in development version - 07/28/15 12:09

Ok, so no crash - just my misunderstanding due to the topic title.

I'll check if the exiting has a particular reason. Possibly it has, otherwise we'll modify the program so that it only removes the entity and continues.
Posted By: Reconnoiter

Re: small request -> max_entities no crash in development version - 07/28/15 13:39

Thanks. If there is indeed a particular reason, I would also like to know if it is also a problem for the published version (just to be on the safe side).
© 2024 lite-C Forums