He-Man

Complete HE-MAN 2019

No permission to download
Project is completed.
bWWd said:
Thats strange, what windows? Im on 7, and never experienced something like this, also what character and stage
It would help if you could post what in log file after crash.Are You guys using version i provided with game or your own openbor.exe ? Dont use other version , it wont work.

Im on windows 10 for me its not one given stage it crashes on it happens randomly on different stages (Some times the stage it crashed on does not crash when i try it again but it crashes on a different stage) Seems to only happen when i play as She-Ra , It seems fine playing as He-Man. Im using the version that come with the download on game jolt.
 
Can you copy log file and paste here right after it will crash? maybe ill get to the problem and fix this.
 
bWWd said:
Can you copy log file and paste here right after it will crash? maybe ill get to the problem and fix this.

Sure buddy if it crashes again i will see if it makes a log file. I redownloaded the game just to make sure i didnt have some sort of old build of it :)
 
bWWd said:
Thats strange, what windows? Im on 7, and never experienced something like this, also what character and stage
It would help if you could post what in log file after crash.Are You guys using version i provided with game or your own openbor.exe ? Dont use other version , it wont work.

Also playing on Windows 7, and we're using OpenBor version that comes with the game. First time it crashed on the stage with haystacks, and the second time it happened on the ice stage, I think.

I wanted to attach OpenBorLog.txt to the message, but the .txt files can not be attached, and the text itself is too long, so I'll post a few lines that may point to the problem:

Level Loaded:    'data/levels/ice.txt'
Total Ram: 8537985024 Bytes
Free Ram: 5758033920 Bytes
Used Ram: 163028992 Bytes
Total sprites mapped: 4529

Script function 'getentityvar' returned an exception, check the manual for details.
parameters: <VT_EMPTY>  Unitialized, "posx", 

********** An Error Occurred **********
*            Shutting Down            *

There's an exception while executing script 'frez' data/sprites/frez.txt
 
NGboo said:

Well, the surface problem is obvious. First, that's not a crash - there's a big difference between an error and shutdown vs. crashing.

What happened here is some script tried to call an entity variable with a blank entity pointer. That's not allowed, so OpenBOR makes an error log and shuts down. If OpenBOR script allowed you to do that and just sent the attempt on through, then it would be a NULL pointer call. In C language that's undefined behavior. It would almost inevitably lead to a memory segmentation fault, and then you'll get your crash alright...  8)

Anyway, that's the problem. Finding the root cause is going to be more tricky, but that's up to bWWd, cause I have no clue. That said, I can offer this:

bWWd, I don't know what value you need from that entity var, and it's probably better to figure out why you are sending it a blank entity pointer, but this could work as a quick fix. First just give the value some stand in default. Then, verify if the incoming entity is a valid pointer. If it is, then you swap in the entity var's value instead.

Code:
value = <some default>

if(typeof(entity_pointer) == openborconstant("VT_PTR"))
{
     value = getentityvar(entity_pointer, <variable name>);
}

Also, NGboo, you can post the text - the whole thing is important. Just enclose it in code tags, like this...

Code:
The text file copy goes here....

HTH,
DC
 
Love You guys, thanks for help im fixing this
Thats the script
Code:
			@script
                void self = getlocalvar("self");
                  void opp = getentityproperty(self, "opponent");
               if (  frame == 1  ) {
 changeentityproperty(self,"parent",opp); 
               changedrawmethod(opp,"reset",1);
   changedrawmethod(opp,"enabled",1);
   changedrawmethod(opp, "tintmode", 1);
    changedrawmethod(opp, "tintcolor", rgbcolor(100,100,200));
        changeentityproperty(self, "velocity", 0,0,0);
           changeentityproperty(self, "speed", 0);
      setentityvar(opp, "posx", getentityproperty(opp, "x"));
		}
		if ( frame > 3 &&  getentityproperty(opp, "x") != getentityvar (opp, "posx") && getentityvar (opp, "posx") != NULL() ) {
            changedrawmethod(opp,"enabled",0);
                killentity(self);
  		}

		if (  frame == 40  ) {
             changedrawmethod(opp,"enabled",0);
  		}

	@end_script
This is used to get rid of blue drawmethod tint after awhile when enemy moved or time passed
Maybe theres easier way to check this, basically if enemy was hit and his position was changed then freeze tint is disabled by this entity.
Would this prevent it from crashing?
Code:
				@script
                void self = getlocalvar("self");
                  void opp = getentityproperty(self, "opponent");
				   changeentityproperty(self,"parent",opp); 
				        void ox = getentityproperty(opp, "x");
						if (  frame == 1  ) {
         setentityvar(opp, "posx", getentityproperty(opp, "x"));
	
	    changedrawmethod(opp,"reset",1);
   changedrawmethod(opp,"enabled",1);
   changedrawmethod(opp, "tintmode", 1);
    changedrawmethod(opp, "tintcolor", rgbcolor(100,100,200));
        changeentityproperty(self, "velocity", 0,0,0);
           changeentityproperty(self, "speed", 0);   
  		}   
		if ( frame > 3 &&  ox != getentityvar (opp, "posx")  ) {
            changedrawmethod(opp,"enabled",0);
                killentity(self);
  		}

		if (  frame == 40  ) {
             changedrawmethod(opp,"enabled",0);
  		}

	@end_script
But that doesnt work sometimes, tint stauys on longer, so id prefere some other method to change tint back to normal after stun attack is complete.
 
Honestly, I can't tell what change you made, but I doubt it will prevent a crash, because I see calls made to getentityvar() without verifying the entity pointer first. If a blank somehow slips through, OpenBOR will catch it and shut down immediately.

DC
 
Well if i set it to my own number when its null, then it will get weird results sometimes or tint wont work.Its better than shutdown but its still workaround .
Is there any better,simpler way to disable tint when enemy will get hit or time will pass ? And the weird thing is that it doesnt shutdown for me at all.
So far i changed it to this, if opponent is null then script wont execute, will this help with this shutdown ?
I think i need to do this for text entities, sometimes it shows EMPTY when calling playuer name and hes dead.
---

This kind aworks but not always, sometimes enemies change animation but still tay blue despite script being active
Code:
@script
                void self = getlocalvar("self");
                  void opp = getentityproperty(self, "opponent");
				   changeentityproperty(self,"parent",opp); 
				       
						void posx;
						void posx2;
						void fram1;
						void fram2;
						void an1;
						void an2;
						if (  opp != NULL() && frame == 1  ) {
					  setentityvar(opp, "fram1", getentityproperty(opp, "animpos"));
					    setentityvar(opp, "an1", getentityproperty(opp, "animationid"));
						 void ox = getentityproperty(opp, "x");
         setentityvar(opp, "posx", getentityproperty(opp, "x"));
		    changedrawmethod(opp,"reset",1);
   changedrawmethod(opp,"enabled",1);
   changedrawmethod(opp, "tintmode", 1);
    changedrawmethod(opp, "tintcolor", rgbcolor(100,100,200));
        changeentityproperty(self, "velocity", 0,0,0);
           changeentityproperty(self, "speed", 0);   
		    settextobj(1, 250 , 280 , 0, -1, an1 , openborvariant("elapsed_time")+2000);
  		}   
		if ( opp != NULL() && frame > 2  ) {
		 setentityvar(opp, "posx2", getentityproperty(opp, "x"));
		 	  setentityvar(opp, "fram2", getentityproperty(opp, "animpos"));
setentityvar(opp, "an2", getentityproperty(opp, "animationid"));
 settextobj(1, 450 , 380 , 0, -1, an2 , openborvariant("elapsed_time")+2000);
  		}
				if ( posx != posx2 && frame > 3 ||  fram1 != fram2 && frame > 3 ||  an1 != an2 && frame > 3) {
            changedrawmethod(opp,"enabled",0);
                killentity(self);
  		}
		if (  opp != NULL() && frame == 40  ) {
             changedrawmethod(opp,"enabled",0);
  		}
	@end_script

 
Hey buddy. As Damon said, you are referring to an empty pointer and this will lead to a shutdown, because NULL pointer is a no go in most coding languages.

The key here, as far as I can see (I am on my phone), is the "opp" variable, probably because the opponent is not valid anymore - and then you are referring to a non existent pointer.

After this line:
                  void opp = getentityproperty(self, "opponent");

Try to add a check, like:
If (!opp){
}

HTH


 
I tried this but freeze doesnt work now
Code:
			@script
                void self = getlocalvar("self");
                  void opp = getentityproperty(self, "opponent");
				   changeentityproperty(self,"parent",opp); 
				        void ox = getentityproperty(opp, "x");
						if (  !opp && frame == 1  ) {
         setentityvar(opp, "posx", getentityproperty(opp, "x"));
		    changedrawmethod(opp,"reset",1);
   changedrawmethod(opp,"enabled",1);
   changedrawmethod(opp, "tintmode", 1);
    changedrawmethod(opp, "tintcolor", rgbcolor(100,100,200));
        changeentityproperty(self, "velocity", 0,0,0);
           changeentityproperty(self, "speed", 0);   
  		}   
		if ( !opp && frame > 3 &&  ox != getentityvar (opp, "posx")  ) {
            changedrawmethod(opp,"enabled",0);
                killentity(self);
  		}
		if (  !opp && frame == 40  ) {
             changedrawmethod(opp,"enabled",0);
  		}
	@end_script
Do you have similar script with such check so i could see how logic and syntax work in it. worst part of scripting for me is structure and exact names of properties.
What ! operator does ? reference doesnt say anything
Ahhh.. its irritating, what the hell is it with entityvars that engine needs to shutdown when opponent is dying or just dead after centisecond, really ?
Had hundreds of scripts before pointing to enemies that already died and nothing happends, but with entityvar its shutdown.
I know that this line gives me issue
Code:
ox != getentityvar (opp, "posx")
I compare new position with old position but enemy died midway
I still would like to see similar script with checks to see if enemy is alive or maybe totally different script to disable tint when enemy is unfrozen.
 
"!" Is a logic operator which means NOT
https://www.programiz.com/c-programming/c-operators

Reference does tells anything about it because it's a basic fundament of coding. It would be the same of explaining what "==" means - people who would use it already know what it means anyway, because is a simple basic operator: it is used in many coding languages and even in pseudo codes.

And sorry, I've reversed the logic, lol.
You need to add a check to see if it's valid and not the opposite.

And you need to add the check right after you declare the variable

void self = getlocalvar("self");
void opp = getentityproperty(self, "opponent");

If (opp){
changeentityproperty(self,"parent",opp);
...

And the problem is not related with the entityvar, but with your code. You are referring to something which doesn't exists - a null pointer - and this will give you a instant crash in almost every single language I am aware of.

You can declare a variable with something with doesn't exist. But once you try to make a reference to it... You are dead ;)
 
bWWd it's like I explained before - it has nothing at all to do with an entity being "dead" or not. It's trying to reference a NULL pointer. You simply can't do that no matter what language or application you're using. It causes memory segmentation faults (a nasty crash due to items in memory sitting at the wrong addresses), and it's also a potential security risk

OpenBOR script is designed to catch and report attempts to reference a NULL pointer before they can crash the engine (and possibly the entire platform with it). This is not a new thing, it's worked that way since the very first day scripting was available.

DC
 
Well. pc version is less sensitive to that, android is crashing i think everytime theres empty value , i wish pc port was like this as well so i could fix everything, i have a lot of calls for variables all over the place, its very hard for me to fix this.
 
bWWd said:
Well. pc version is less sensitive to that, android is crashing i think everytime theres empty value , i wish pc port was like this as well so i could fix everything, i have a lot of calls for variables all over the place, its very hard for me to fix this.

Sort of, there's no being more or less sensitive to a NULL pointer. It's a very yes/no kind of thing. You either have a NULL or you don't, and you can neve reference NULL. I know this will probably get TLDR, but I'll try to explain why, and maybe it will help you understand and debug...

Objects in OpenBOR like entities and such are pointers. Pointers are literal memory addresses. When you deference a pointer, like an entity, you are saying, go to memory address X and get me everything in it. You can even see this if you output one to the log. It will look something like "#22328201". That's the physical location of a single byte of memory in your computer/PSP/whatever.

Let's say you want one entity's current opponent. You ask Openbor script for it, and you'll get one of two things: A memory address or a NULL. If you get the memory address, it's the part of memory the opponent entity's (and all its properties) occupy. So with that in hand, you can do stuff to the opponent entity by modifying those values that are in memory. Change its colors, make it die, whatever, right?

OK, but what if there isn't an opponent? You get a NULL value. Again, no problem... NULL values are how we know nothing is there. Until you try to do stuff to it anyway. In which case, you are literally telling the computer to read or write memory without telling it where. It's like ordering from Amazon, but giving them nothing in the address line. Except for a big difference - Amazon will tell you to go spit. Computer hardware won't. It will merrily do whatever you say and start manipulating memory without rhyme or reason.

Most of the time, memory that has nothing at all to do with what you intended gets corrupted. 999 times out 1000, when a computer crashes, this is the reason why. Today's operating systems try to compartmentalize apps and kill them on sight before they bring the whole platform down, but it can still happen. Most smaller platforms just crash and require a hard power cycle. Even worse than that, purposely using segfaults to write memory outside the target application is a common hacking technique.

Because of all that... most languages today will throw errors and close out the app themselves, and OpenBOR script is no different. That way you at least get an error to work with instead of a system crash or some a**hole erasing your primary drive with a rootkit.

As I understand, the Android port has a problem with certain localvar calls returning a blank (NULL) value when they shouldn't. My guess is in the Android version, the localvar that populates opponent is returning NULL even when an opponent is there. Since your code assumes the pointer isn't NULL, it tries to do work on it and OpenBOR shuts down.

I would start putting log() commands to output your variables to the log and see what's in them. When you see a "BLANK Uninitiated" right before the shutdown alert, you've found your guilty value.

Example:
Code:
void self = getlocalvar("self");
void opp = getentityproperty(self, "opponent");

log("\n\n self: " + self);
log("\n\n opp : " + opp);

DC
 
Here's my playthrough of the latest version bro:

https://www.youtube.com/watch?v=lwZRX33a89w

The Cambro mission is a pain in the ass lol, it took a few tries to beat it!!!  I noticed if your not careful you'll be your ass handed to you by a whole bunch of enemies lol, that's why I picked the cats (Battlecat/Panthor) so I could get up lives easily then choose different characters to play as!!!  You really do need four players to play this, it doesn't do the game justice!!

Sometimes I wasn't really able to see my character because of the mist filter you have over the level like Orko, and I noticed he's hard at trying to pick up health as well:

https://youtu.be/lwZRX33a89w?t=3509

Other than that it's pretty good bro, doesn't feel like a demo at all!!  Do you plan on adding anything other to this like cutscenes, more characters, etc. or are you done!!  I would like to see an different intro than the one you used (the regular filmnation one) though your probably going for nostalgia!! 

I remembered you were making an TMNT game, anything about that or is it still a work in progress!!  Anyways thanks for the game again bro, greatly appreciated looking forward to see what you come up with next!! ;D
 
Thanks for playing ! I know Cambro level can be frustrating sometimes especially when you respawn and enemies run through him to get you, i had him take a couple hits before he runs away , maybe ill change it back.
I removed mist filters , replaced them with other ones thats less obscuring.
Its definitely not final version but the one that has beginning and boss battle at the end, so its kinda complete.
------
DC, sometimes i use text object to display acquired value from variable to be sure its not NULL but most convenient would be if engine knew that value is null and would not use it, ignore script commands that try to use it but still output the problem to log as a warning( entityvar "daytime" is EMPTY, or something like that).Kinda like missing samples warning.IMO crash is the worst outcome.
Im not supergood at scripting, not even decent but this would definitely help.
 
Hi, just wanted to let you know the game is great, I'm playing through it right now.  Quick question though, is it possible to use a game pad/controller with the game?  It doesn't seem to recognize any of my Windows controllers (XBOX controller), even with keyboard emulating software installed (and the Gamepads Enabled option).  Is there something I'm missing to get this to work?

Let me know,
Thanks.
 
All good gamepads dont currently work, you have to get one of these amazing chinese ps3 knockffs  ;D sorry for inconvenience, i have 4 and they work fine, that issue is well known, it is fixed in new versions AFAIK but other stuff is broken so until thats fixed they still dont work.
 
Back
Top Bottom