Solved Minor Help

Question that is answered or resolved.
For some reason my player can't connect any attack after the first attack connects. The animations play but there is no move contact or damage. I have the attack boxes set as well as damage and pause times and I added atchain 1 2 4 3 in the header so I can't think of what could be causing this also the first attack seems to rarely to connect as well so any info on the issue would be appreciated.
 
I'm getting this error message and I'm stuck trying to fix it could anyone shed any light on the issue? My mod fully loads up to the select screen and once the stage begins loading it crashes with this error

Code:
Warning: 1 script variants are not freed, dumping...
openbor_allocscreen

This is the part of the script that it's referring to I believe, I'm just not sure what course of action is needed to fix the error
Code:
{
   void vscreen = openborvariant("vscreen");
   int maxz=openborvariant("PLAYER_MAX_Z")+1000;
   int zoom_value=getglobalvar("zoomvalue");
   int zoom_x=getglobalvar("zoomx");
   int zoom_y=getglobalvar("zoomy");
   void ent=getglobalvar("zoomentity");
   int px=getentityproperty(ent,"x") +  zoom_x - openborvariant("xpos");
   int py=getentityproperty(ent,"z") + zoom_y - openborvariant("ypos") - getentityproperty(ent,"a");
   void zoom_scr = getglobalvar("zoomscreen");
   if(!zoom_scr){      
   zoom_scr = allocscreen(openborvariant("hResolution"),openborvariant("vResolution"));
      setglobalvar("zoomscreen",zoom_scr);
   }
 
ok so I'm still trying to add the zoom function to DC's Tinting script and as I have it now the game only runs with half of the zoom function added but the zoom function isn't working in game it just isn't causing the game to crash. If I add the complete function I get an error about allocscreen, from looking at this I can't figure out why it runs with only half the function added so if someone could explain that I'd be grateful. I'm new to script but I'm studying it and using the script index thread as well as other scripts and the error log as a guide so a basic explanation would help


Here's the script with partial zoom function

Code:
 // If you have any screen controlling functions, such
    // as full screen zomming, place them here.

 void vscreen = openborvariant("vscreen");
   int maxz=openborvariant("PLAYER_MAX_Z")+1000;
   int zoom_value=getglobalvar("zoomvalue");
   int zoom_x=getglobalvar("zoomx");
   int zoom_y=getglobalvar("zoomy");
   void ent=getglobalvar("zoomentity");
   int px=getentityproperty(ent,"x") +  zoom_x - openborvariant("xpos");
   int py=getentityproperty(ent,"z") + zoom_y - openborvariant("ypos") - getentityproperty(ent,"a");
   void zoom_scr = getglobalvar("zoomscreen");
   if(!zoom_scr){
      zoom_scr = allocscreen(openborvariant("hResolution"),openborvariant("vResolution"));
      setglobalvar("zoomscreen",zoom_scr);
   }
   clearscreen(zoom_scr);

  }


here's the omitted half of the function

Code:
 //draw what we need 
   drawspriteq(zoom_scr,0,openborconstant("MIN_INT"),maxz,0,0);
   //setup drawMethod
   changedrawmethod(NULL(),"reset",1);
   changedrawmethod(NULL(),"enabled",1);
   changedrawmethod(NULL(),"scalex",zoom_value);
   changedrawmethod(NULL(),"scaley",zoom_value);
   changedrawmethod(NULL(),"centerx",px);
   changedrawmethod(NULL(),"centery",py);
   //Draw the resized customized screen to main screen.
   drawscreen(zoom_scr,px,py, maxz+1);
   changedrawmethod(NULL(),"enabled", 0);
   drawspriteq(vscreen, 0, maxz+1,maxz+1, 0, 0);
   drawspriteq(vscreen, 0, maxz+2,openborconstant("MAX_INT"), 0, 0);
   clearspriteq();

 
BeasTie said:
Dunno about zoom,
But I added tint script to a mod, and it prevented all the other drawmethod commands from working.

That's true for the script I posted here because it turns off drawmethod if the entity isn't frozen. But the one from my demo module only turns off tint and doesn't interfere with other draw methods. Make sure to use it instead.

DC
 
NP, I was just trying it out, but I had no need for freeze yet so disabled it.  I did use the demo version script.  I think it might not be compatible with my old blink.c script.  So I started editing tint script to do that instead :)
 
For certain enemy projectiles I want the players block attack to reflect that projectile back at the enemy using shoot, I used blockpain to do this which works except some enemies throw multiple projectiles such as shooting 3 times and I want the players block to reflect two shots and be unable to block the third but the way blockpain normally functions this won't work because the attack has to exceed the players blockpain int to trigger the blockpain anim and once triggered all following attacks can not be blocked. Anyone have a suggestion for a better workaround for this?
 
alright I'll give it a shot thanks for the suggestion

@DC For some reason the drawmethod is being affected by the tint script and I tried it in the most recent build and got the same results and I'm going to have to hope someone can come through for me and either detail how to call the zoom function through your script or just reference another mod that tries it because I'm just too far behind with script right now to approach tackling that but I definitely want to use it because its a really great feature and saves a ton of work so thanks again coming up with it and trying to make it noob friendly to implement
 
@BB I don't think counter range will work since I was using specific attacks ex. attack6 to trigger the reflect attack from what I read about counter range it seems this would be triggered by all incoming attacks which wouldn't make sense
 
FINALLY!!! lol I got it to work finally, I imported the tint script through the zoom function and everything is working now thanks again for the script DC ;D


edit-
Drawmethod still seems to be effected but everything else seems to be working as it should

edit2-
@beastie I figured out the issue with drawmethod in the tint script you have to turn it off again at the end. Now everything is running perfect

Code:
// If we got this far without exiting, there was no effect to apply.
    // Clear any previous tints and entity vars.
    changedrawmethod(ent, "tintmode", 0);
    changedrawmethod(ent, "tintcolor", 0);
    changedrawmethod(ent, "enabled", 0);
 
Glad to see you got it working, though you shouldn't be importing one script into another per say. You want to import them both into the main script that executes them (in this case updated.c).

Code:
#import data/scripts/whatever....
#import data/scripts/whatever else...
...

main()
{
     execute function...
  
     execute another function...
}

In other words, you should move the zoom function into its own file, the same way my tint function is. Then you import and execute. Your updated.c should then look something like this:

Code:
// Import functions.
#import "data/scripts/common/effect_tint.c"
#import "data/scripts/common/zoom.c"

void main(){

    void    ent         = NULL();   // Target entity pointer.
    int     ent_count   = 0;        // Entity count.
    int     i           = 0;        // Loop counter.

    // Get entity count.
    ent_count = openborvariant("ent_max");

    // Loop over each entity index.
    for(i=0; i<ent_count; i++)
    {
        // Get entity pointer.
		ent = getentity(i);

		// Execute tint effect on entity.
        effect_tint(ent);
    }

    // If you have any screen controlling functions, such
    // as full screen zooming, place them here.
    if(getglobalvar("zoomentity"))
    {
      zoom();
    }
}

DC
 
Wow i was close to using that setup a couple times lol thanks again. Quick question DC what coding language is this engines script closest to? Im starting to learn c/++ but i noticed there are differences in the way things are written out in c++ compared to openbor, im sure your well versed in several languages so you would know the best place to start
 
Thegr8test said:
Is there a way to hit all enemies on screen other than smartbomb or is it possible to use smartbomb in unison with a freespecial?

Just make a a huge attackbox with high "z" level.

You can take a look at April's special attack in TMNT Rescue Palooza.
 
The alternate way is to use script to create smartbomb

Difference with using attackbox is that script based smartbomb will hit enemies regardless of bbox while the latter only hit ones with active bbox
 
Is it possible to use this script with projectiles or is there a similar script for this?

Code:
void spawn01map(void vName, float fX, float fY, float fZ)
{
	//spawn01 (Generic spawner)
	//Damon Vaughn Caskey + Douglas Baldan
	//07/06/2007
	//
	//Spawns entity next to caller.
	//
	//vName: Model name of entity to be spawned in.
	//fX: X location adjustment.
	//fZ: Y location adjustment.
      //fY: Z location adjustment.

	void self = getlocalvar("self"); //Get calling entity.
	int  iMap = getentityproperty(self, "map"); // Get caller's remap.
	void vSpawn; //Spawn object.
	int  iDirection = getentityproperty(self, "direction");

	clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

	if (iDirection == 0){ //Is entity facing left?                  
          fX = -fX; //Reverse X direction to match facing.
	}

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
	
	vSpawn = spawn(); //Spawn in entity.

	changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
	changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
	changeentityproperty(vSpawn, "map", iMap); //Set map.
    
	return vSpawn; //Return spawn.
}
 
Back
Top Bottom