PDA

View Full Version : Arg Assignment Iidea.



Zim
01-04-2013, 02:42 PM
The recent addition of being able to assign a different script to the ffc is really useful and everything. It made me think of something else (actually I thought of this years ago but didn't bother writing you about it yet) when I went to implement that into some screens of mine:
Would you developers, if you have the time, make a pointer-assignable argument changer for the ffcs? It'd be for changing messages, item availability at shops, the graphics, etc..
Reassigning a new script to the same ffc would make me have to write out a new script for every time the events flags in my game trigger an FFC NPC to say something different, give a new item, etc.. which would be fine except for that I like to use the FFCs for graphical reasons to make seamless looking transitions between the terrains and things like that, so it would be nice to have as many of them available as possible. FFC->Script solves that problem, however, like I stated, that method makes it so I have to write a new message, graphic, etc. script for each change in the FFC's behavior. A function that could reassign the FFC's args like


void ArgChange(int a,int b,int c,int D,int x)
{
if(Game->GetCurDMap()==a&&Game->GetCurScreen()==b) //Function only activates on screen a of DMap b
{
ffc FFC=Screen->LoadFFC(c);
if(D==0){FFC->D0=x;} // <---This line here is the one not implementable yet.
if(D==1){FFC->D1=x;}
if(D==2){FFC->D2=x;}
if(D==3){FFC->D3=x;}
if(D==4){FFC->D4=x;}
if(D==5){FFC->D5=x;}
if(D==6){FFC->D6=x;}
if(D==7){FFC->D7=x;}
if(D==8){FFC->A1=x;}
if(D==9){FFC->A2=x;}
}
}//With this script someone could change the arguments of the given ffc of the given screen on the given dmap triggered by any other game event when it occurs by writing in the ArgChange
//function. That would be so sweet!

I understand that what I'm asking can be done by assigning a global variable to the script and changing it via another script when the event in question occurs, however, due to the global variables limit, and the massive amount of content I would like to have in my quest eventually, it would be very desirable to be able to change that with a function instead of having to use a global variable at all.
Thanks again guys 'n gals!

Saffith
01-04-2013, 03:53 PM
That's ffc->InitD[].

Zim
01-04-2013, 04:58 PM
That's ffc->InitD[].

Oh yeah! I remember seeing that before. Sorry I bug you about things that slip my mind sometimes Saffith, you're great for helping me though. That last thing you reminded me about for(blah blah, x+=16) is something I had already thought of too and forgot about.


void ArgChange(int a,int b,int c,int D,int x)// (Dmap, Screen, FFC, Argument, What to change the argument to)
{
if(Game->GetCurDMap()==a&&Game->GetCurScreen()==b) //Function only activates on screen a of DMap b
{
ffc FFC=Screen->LoadFFC(c);
// Changes Argument (D) of ffc (c) on screen (b) of DMAP (a) to x
if(D==0){FFC->InitD[0]=x;}
if(D==1){FFC->InitD[1]=x;}
if(D==2){FFC->InitD[2]=x;}
if(D==3){FFC->InitD[3]=x;}
if(D==4){FFC->InitD[4]=x;}
if(D==5){FFC->InitD[5]=x;}
if(D==6){FFC->InitD[6]=x;}
if(D==7){FFC->InitD[7]=x;}
if(D==8){FFC->InitD[8]=x;}
if(D==9){FFC->InitD[9]=x;}
}
}//With this script someone could change the arguments of the given ffc of the given screen on the given dmap triggered by any other game event when it occurs by writing in the ArgChange
//function.


Well alrighty then. Maybe this post should go into the Scripting Database then instead now that it's done. Thanks!