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.
 
Yeah, that's because there is no such thing as "burning", "Shocked", etc. - to the engine they're more animations. Freeze is its own thing and that's why it has flags.

If you prefer flags nothing stops you from making some of your own, and obviously there's a lot other things you could check for as well. The animation method just happens to be an obvious one.

DC
 
I just added the improved script and it works fine as far as tint is concerned but I believe its using zoom on items and some projectiles what would I need to adjust to fix this? Here's an example of what I mean the 1up item isn't supposed to be that large and drawmethod is used to make it smaller and everything affected uses drawmethod but other than that the defrost effect you added to tint is pretty cool

[attachment deleted by admin]
 
Thegr8test said:
I just added the improved script and it works fine as far as tint is concerned but I believe its using zoom on items and some projectiles what would I need to adjust to fix this? Here's an example of what I mean the 1up item isn't supposed to be that large and drawmethod is used to make it smaller and everything affected uses drawmethod but other than that the defrost effect you added to tint is pretty cool

I'll have to come up with a more nuanced solution for you. As written, the tint function resets drawmthod on entities to turn off tints - meaning it's overriding your other settings.

DC
 
Still, it's a bit of a shotgun solution on my part to outright erase all the drawmethod settings on an entity just to clear tint effect. I'll look into getting a function built that doesn't have to do that.

DC
 
Yeah both is good, it would be a useful script.  But I just mean as far as scaling goes, sprites resize with rotsprite usually look better than the drawmethod scaling.
 
Just posted a demo module here with a polished up version of my tint script. This one no longer resets the entire drawmethod - just the part it uses (tintmode and tintcolor). That means it won't interfere with other drawmethods in your module.

For purposes of being a simple plug and play for everyone, it does NOT include the zoom script, but please actually read the scripts and you'll see how to insert it. I spent a lot of time making sure everything was fully documented to make it easy.

Enjoy!
DC
 
I tried using the updated.c from the demo along with the file in the common folder but I'm getting this error message

Code:
Total Ram: 4207882240 Bytes
 Free Ram: 2167451648 Bytes
 Used Ram: 3035136 Bytes

debug:nativeWidth, nativeHeight, bpp  1360, 768, 32

1 joystick(s) found!
OpenBoR v3.0 Build , Compile Date: Dec 30 2013

Game Selected: ./Paks/MFA2.PAK

FileCaching System Init......	Disabled
Initializing video............
Reading video settings from 'data/video.txt'.
Initialized video.............	480x272 (Mode: 1, Depth: 32 Bit)

Loading menu.txt.............	Done!
Loading fonts................	1 2 3 4 6 Done!
Timer init...................	Done!
Initialize Sound..............	
Loading sprites..............	Done!
Loading level order..........	Done!
Loading model constants......	Done!
Loading script settings......	Done!
Loading scripts..............	

Script error: data/scripts/updated.c, line 24: Invalid declaration(expected comma, semicolon or initializer?) '(' (in production 'decl')

void zoom()
         ^



Script error: data/scripts/updated.c, line 59: Invalid declaration(expected comma, semicolon or initializer?) '(' (in production 'decl')

void main(){
         ^


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

Failed to parse script file: 'data/scripts/updated.c'!
Total Ram: 4207882240 Bytes
 Free Ram: 2118848512 Bytes
 Used Ram: 28733440 Bytes

Release level data...........	Done!
Release graphics data........	Done!
Release game data............


Release game data............	Done!
Release timer................	Done!
Release input hardware.......	Done!
Release sound system.........	Done!
Release FileCaching System...	Done!

**************** Done *****************

Failed to parse script file: 'data/scripts/updated.c'!
 
it also crashes when I add the zoom script in the updated.c. Is it something I'm doing wrong or could it be the build I'm using?



Code:
// Import functions.
#import "data/scripts/common/effect_tint.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 zomming, place them here.

}


void zoom()
{
   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);

   //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();
}


void main(){
   if(getglobalvar("zoomentity"))
   {
      zoom();        
   }
}
 
Thegr8test said:

You added a second main(), and that's not allowed. You can never have two functions with the same name in a script. How would the engine know which is which?

Remember when I said you should read the scripts carefully? Look closely at the main() from my demo. There are instructions right inside of it that show where you would place the call for zoom().

DC
 
I tried using the log as a guide for what I'm doing wrong when making changes to the zoom function but the best I got was the game will load but crash after I select a character, I then imported updated.c from the demo through the original from my mod and changed the demo's to updated2 which gets the tint effect to work but it doesn't zoom at all anywhere. If its not obvious I'm not really familiar with editing scripts  ;)
 
Honestly, I can't follow at all what you just said. Regardless, I know exactly what your problem is and it's an easy fix, but I've already explained once - repeating myself won't help anything.

I'm also going to be away from my comp for a while so I can't just do it for you. Anyone else with script experience care to field this one?

DC
 
Back
Top Bottom