This is probably very simple, but maybe not... I wouldn't know. I don't know any javascript beyond a hand full script calls.
I do understand java formulas though. And those I use a lot.
Simple example:
In this example, I save the card ID in the variable with the same ID as the slot, which is stored in \v[3]. I also use this slot ID as index to find the right coordinates. Then it shows an image with the name "Card1.png" or "Card2.png" on the right coordinates.
However... Those var values never change. So the first 5 lines in this case (sometimes it is more like 10 or 12) are always what they are. X is always v[14].(v[3]) and name is always "Card" + v[1].
The commands I made with those var values are different with each action, but I use the same var values over and over.
However, in every single script call, I need to put all those var= this and var= that again, even though they are always the same.
So now I would want to make this part permanent:
So I can make all kinds of formula's, like this, without the need of the above:
This is probably really easy to do, or maybe it isn't even possible. I wouldn't know. That is how much I know of javascript. 😛
I don't need anyone to make a full plugin for me. I am a quick learner, so if anyone can show me how to do this for 1 or 2 var values, I would be able to do the other 30 or so myself. It would make my life a lot easier and I'd be happy as a clown. :hhappy:
I do understand java formulas though. And those I use a lot.
Simple example:
JavaScript:
var cardId = $gameVariables.value(1);
var name = "Card" + cardId
var slot = $gameVariables.value(3);
var x = $gameVariables.value(14)[slot];
var y = $gameVariables.value(15)[slot];
$gameVariables.setValue(slot, cardId);
$gameScreen.showPicture(slot, name, 1, x, y, 100, 100, 255, 0);
In this example, I save the card ID in the variable with the same ID as the slot, which is stored in \v[3]. I also use this slot ID as index to find the right coordinates. Then it shows an image with the name "Card1.png" or "Card2.png" on the right coordinates.
However... Those var values never change. So the first 5 lines in this case (sometimes it is more like 10 or 12) are always what they are. X is always v[14].(v[3]) and name is always "Card" + v[1].
The commands I made with those var values are different with each action, but I use the same var values over and over.
However, in every single script call, I need to put all those var= this and var= that again, even though they are always the same.
So now I would want to make this part permanent:
JavaScript:
var cardId = $gameVariables.value(1);
var name = "Card" + cardId
var slot = $gameVariables.value(3);
var x = $gameVariables.value(14)[slot];
var y = $gameVariables.value(15)[slot];
So I can make all kinds of formula's, like this, without the need of the above:
JavaScript:
$gameVariables.setValue(slot, cardId);
$gameScreen.showPicture(slot, name, 1, x, y, 100, 100, 255, 0);
This is probably really easy to do, or maybe it isn't even possible. I wouldn't know. That is how much I know of javascript. 😛
I don't need anyone to make a full plugin for me. I am a quick learner, so if anyone can show me how to do this for 1 or 2 var values, I would be able to do the other 30 or so myself. It would make my life a lot easier and I'd be happy as a clown. :hhappy:
Note that I am not trying to do this just for things like "var slot = $gameVariables.value(3)". Most formula's I use are a bit longer, but still are always the same. Like:
So in my formulas I can use "stat[2]" to find the ATK of enemy which ID is saved in the var with the ID which is saved in var 3... Do you still follow? This is making things so complicated for anyone with no idea what I am using this for. And it gets way more complicated that this.
So, to avoid confusion, I made up the easiest example I could think of.
After all, when I know how to make a plugin that permanently makes "slot" into "$gameVariables.value(3)", then I also know how to do the same thing with larger, more complicated formula's.
Code:
var stat = $dataEnemies[$gameVariables.value($gameVariables.value(3))].params
So in my formulas I can use "stat[2]" to find the ATK of enemy which ID is saved in the var with the ID which is saved in var 3... Do you still follow? This is making things so complicated for anyone with no idea what I am using this for. And it gets way more complicated that this.
So, to avoid confusion, I made up the easiest example I could think of.
After all, when I know how to make a plugin that permanently makes "slot" into "$gameVariables.value(3)", then I also know how to do the same thing with larger, more complicated formula's.