Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses

Script box functions v0.7


by Astfgl66




Everyone does event making. While most needs are met by the basic functions provided in editor, some are not. Have you ever tried giving an item to the party by id instead of the drop down menu? That's right you can't. You have to use the script command. After some searching you will find a list of script calls....


Let's continue my example and say you want to give the party  [n] amount of weapon [id] stored in variable [1], you'd have to type that:


$gameParty.gainItem($dataWeapons[$gameVariables.value(1)], n, true/false)


That's ridicoulously long and complicated for what should be a simple thing, don't you think?


And thats the goal of this plugin: provide a simple syntax to use while eventing your script calls.


Lets take my example and put it in my new syntax:


add_weapon(RV(1),n,true/false)


Isn't it better? It's both easier to remember and easier to write, it guarantees quicker and more efficient eventing via script calls. It saves you time. And time, i think, is pretty much the most precious ressource a game dev can have.


Features:


   - More than 100 functions to use during your script calls. Almost all functions in the event command menu have had their syntax simplified.


   - Some new functions: Check if event is inside a rectangle, a circle, a polygon, jump to a label contained in a variable,...


   - Window creation and manipulation


Download:  http://pastebin.com/kSBxY0mg


Old versions:

http://pastebin.com/KKjv0GNh V0.6


Because of unintended behaviour the older versions have been discontinued.





Or find both the plugin and the help file attached to this post.


How to use:


Plug and play. There are no params available. Just be sure to name the plugin file "Astfgl", without the quotes.


How is it done?


The only thing this plugin modifies in the game is the script box event command. Everything is drawn from the data base using the original functions.


That means if you input SV(1,6) the game actually interprets it as $gameVariables.setValue(1,6), it doesn't modify the base function, only provides an alternate way of calling them.


That way, it should be compatible with almost any plugin.


Futhermore, since it doesn't change or remove the original script calls, all your former eventing works are fully compatible!



Example of application: making a nice gauge:

EDdecu0.png



SV stands for Set Variable(variableId, value): it sets variable n* [variableId] to [value].


RV stands for Read variable(variableId): it returns the value of variable n* [variableId].


pic_move and pic_tint are pretty self explanatory nut their argument list is quite long, so see documentation for that :)


The event at the top is for setting up the gauge, then in order to increase or decrease its value, and at the right you can see how it looks.



Example n*2: Creating and remembering sets of equipment to use later:

Qxow25U.png



SV stands for Set Variable


SVA stands for Set variable array (variableId,index,value) it is used to modify a single index of an array that is stored in a game variable at a time.


RVA stands for Read Variable Array (variableId,index), it returns the value stored inside index [index] of a game variable that is an array.


equip_id(actorId,slotId), returns the id (as in the database number) of the equipment of actor [actorId] in slot [slotId]


actor_equip_w(actorId,slotId,itemId) changes the weapon of actor [actorId] in slot [slotId] to weapon n* [itemId].


actor_equip_a does the same but for armor.


Okay: here is of it works.


First we set variable 3 to an array of 5 numbers. Then we set each position of the array to the corresponding slot equipment id.


Ie: Weapons go to slot 0, shield to slot 1, head to slot 2,...


Then by calling the second part we take advantage of the ability to equip an item by its id by retreiving what is inside variable 3, and equipping the corresponding item to the corresponding slot. It should be fully compatible with your scripts that add or remove equipment slot, you'll have to remember how many slot the actor has, and what they contain (a weapon or an armor) and change the number of calls accordingly though.


If you don't like arrays it can of course be done with multiple variables, you'll just need 1 per slot instead of 1 for the whole slot.



Example n*3: Drawing on the map and window manipulation

tXl3Q4.gif



V0.7:


YX6iKq7.png



Why should You care about script commands? Some examples of what script functions can achieve and/or facilitate:


   - Easy variable manipulation: if you wanted to calculate ((V1)+V(2)*V(3))/(V(4) you'd need a lot of lines or a very verbose script call. No more! It's as easy as (RV(1)+RV(2)*RV(3))/RV(4).


   - Modify any self switch! Ex: Set self switch [id] of event [eid] of map [mid] to true: SSelf(mid,eid,"id",true)


   - Give item to the party by id : add_item(id,n)


   - Play an animation by id! show_anim(eid,anim_id)


   - Better picture manipulation: You can easily create gauges, no need for a plugin! You just need two images (the back and the filling) and a bit of eventing magic.


   - Return almost anything you can think of, an actor description, profile, parameter, note (maybe you'd like to retrieve your notetags, you can!), same for skills, monsters, equipments,...


   - Array manipulation functions included.


   - Check if an event is inside a polygon! Who needs a line of sight plugin anyway?


   - Jump to a label which name is contained in a variable. This is both versatile and powerful, allowing you to create the equivalent of functions in your events!


   - Manipulate battler sprites position angle and scale!


   - Simple window creation and manipulation functions, with gauges, text and icons.


Known bugs:


I did not find any while testing myself. If you do, be sure to leave a comment or a PM.


License:


It's detailed inside the script: but it boils down to this: You can use the plugin for free or commercial use. You are free to edit and redistribute it as long as you don't claim ownership and keep the released product under the same license. You may not repost this plugin on any other forums than this one without my express permission: link them back here. You must give credit.


The point in polygon formula was taken from the internet and as such requires proper crediting for its use. I have made sure they allowed all uses, and I do not claim ownership of the code. Please see in the credits section for what you should put in your credits.


How can You help?


If you've been following you've noticed i said almost all functions have been shortened, the first way you can help is providing me with verbose script calls that i have missed so i can shorten them and add them to my plugin.


Things i deliberately chose not to do: anything related to messages and sound. It's very complicated, and there is not much to shorten,  anything related to move route, this script call is a nightmare (except easy access to the jump function).


Thank you for reading.


Credits:


I would like to thank:


     -Plugin template made by Faytless / Thomas Pham. Without that, I  would still be making modification in the core files.
     -The point in polygon check formula was taken from the internet. Credit in comment near the command along with link to the source.


It is released under MIT license (both it and the works it is based upon). Which means that you have to credit them and include a copy of their license if you use their work.


I provide links to the original documents where they are found with a copy of the licenses you have to put in your credits  in spoilers below. I made sure they allowed all uses for their work, such as redistributing and mofiying, sublicensing, selling, etc...


Links:


Required credits:

Ray casting algorythm:


Copyright (c) 1970-2003, Wm. Randolph Franklin


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
  2. Redistributions in binary form must reproduce the above copyright notice in the documentation and/or other materials provided with the distribution.
  3. The name of W. Randolph Franklin may not be used to endorse or promote products derived from this Software without specific prior written permission.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Point in polygon javascript formula:


https://github.com/substack/point-in-polygon


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


     -RPG Maker extender project for RPGMaker VXACE, for providing me with the idea and need to do this plugin.
     -Tsukihime for the plugin jump_to_label via script call for Ace, which inspired me to write the function for MV.


View attachment Astfgl.js


View attachment AstfglPlugin Commands V0.7.xlsx
 
Last edited by a moderator:

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
Two big news, my plugin thread has been approved, Yay!


And an update, adding several new functions and rewriting several others.


What's new?


Easy checks for if an actor is in party by name and id.


Return an actor equipped armor or weapon types in a list.


Easy way to check if an actor is equipped by at least an equipement type. Example:  actor_weapons_contains(1,1) will return true if actor n*1 is equipped with at least 1 dagger.


Rewrote the weapon armor and item checks to allow for more user flexibility (notably the ability to specify if you want to include equipment or not).


Some other tweaks, an an updated documentation.


New pastebin links and attachments in the main post.


Have fun folks!
 

matthew30903

Veteran
Veteran
Joined
Jun 29, 2014
Messages
84
Reaction score
32
First Language
English
Primarily Uses
RMMZ
I will have to test this out, but it sounds useful. Thank you for providing it.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
Thank you for the nice comment!


I hope you find my plugin useful.


I went and added an example of how to make a pretty gauge with some simple script calls in the main post.
 

matthew30903

Veteran
Veteran
Joined
Jun 29, 2014
Messages
84
Reaction score
32
First Language
English
Primarily Uses
RMMZ
Is there a way to check the actor ID of the first actor in the party?
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
If you don't find it in the documentation I haven't put it in yet.


Meanwhile here is the script call to return the id of the first actor in the party :


$gameParty.members()[0].actorId()


So if you want to check who is the first party member do a conditional script with this: 


$gameParty.members()[0].actorId() === id_you want _to_check


Obviously replacing the second part by the id you want.


That's a nice idea! I'll add a command in a future update, such as party_leader(), and party_leader_n(). Thanks for the suggestion.


Edit: I went ahead and created the functions: paste this snippet after any other function if you don't want to wait for a further release:

party_leader = function() {
return $gameParty.members()[0].actorId()
}

party_leader_n = function(id) {
return $gameParty.members()[0].name()
}

actor_is_leader = function(id) {
var id
if (party_leader() === id) {return true} else {return false}
}



If you do it you have a way to return the party leader by name and id as well as an easy way to check if a party member is the leader by its id.


These three commands will be added in the next versions.
 
Last edited by a moderator:

takashi1kun

spaghetti god code
Veteran
Joined
Jul 27, 2014
Messages
104
Reaction score
39
First Language
Spain Spanish
Primarily Uses
i lov yu so much, ARRAYS!!!!! I LOVE ARRAYS!!! Now you are my new god :V 
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
Why, thank you for the nice comment :)


Anyway, new update is out.


New features: 9 script calls, including the 3 mentionned above, an easy way to check if an event is in a particular region and calls to get the current value of an actor hp, mp and tp. See detailed list in spoiler.

actor_hp(actorId) // will return actor [actorId] current hp I can't beleive i forgot those three...
actor_mp(actorId) // will return actor [actorId] current mp
actor_tp(actorId) // will return actor [actorId] current tp
actor_armors(actorId) // will return actorId current equipped armors in a list
actor_weapons(actorId) // will return actorId current equipped weapons in a list
event_regionC(eventId,regionId) //will return true if event [eventId] is in region [regionId]
party_leader() // will return the party leader id
party_leader_n() // will return the party leader name
actor_is_leader(actorId) // will return true if actor [actorId] is the party leader



Also updated documentation and improved code by adding default values to booleans and the picture show and move commands:

pic_move(pictureId, origin, x , y, scaleX, scaleY, opacity, blendMode, duration)
// you can now input
pic_move(pictureId, origin, x , y) //and it will auto fill the rest of the values

pic_show(pictureId, name, origin, x , y , scaleX, scaleY, opacity, blendMode)
//you can now input
pic_show(pictureId, name, origin, x , y) //and it will auto fill the rest of the values



That's all for today, have fun guys!
 

Johan Liebert

Villager
Member
Joined
Apr 6, 2016
Messages
12
Reaction score
1
First Language
French
Primarily Uses
You just made my day. I'm a huge eventer and i was bored with all the script calls and endless workarounds I used to make my systems run but wandering on the site and i found this . I' ll definitly use it. This is really huge.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
Thank you for the nice comment!


New version is out!


V0.4 includes 30 new commands, mainly focused about battle ths time.


Highlights are:

  • You can now move the enemy and player sprites around during battle! Want to make a skill that moves an enemy back? You can!
  • You can now set an angle and a scale to enemy and player sprites during battle! Always wanted an attack that made your player grow (or shrink) in size? Your dreams are true now!
  • Play an animation by id on an enemy
  • Add/Remove/Check for a state by id for an enemy.
  • The next three are targeted at making skills that call a common event:
  • Return the caster index for a skill used by an actor!
  • Return the target index for a skill used by an actor! (Tested while targeting a single enemy. not sure if it works for targeting an actor, but it should. Not tested for multiple targets.)
  • Return the id of the skill being used!

This took quite a while, and I learned much while doing it, no drawing on map, text or something else this time. But it will come, I promise!


Known, not a bug:


Using any of the commands placed after the big red "Use only during battle" outside battle will crash your game. You have been warned.


Changing HP to 0 or adding the death state via commands will not make the enemy sprite dissapear. Use the command enemy_collapse() after to do it.


RPG maker engine is weird sometimes... When using enemy_xy the index is the reverse order from which the enemy were added in the troops tab (so 1 for Bat A, 0 for Bat B ). But! actor_target() will return in the normal order (0 for Bat A, 1 for bat B). So if you use enemy_xy(actor_target(),x,y) the wrong target will move... This is normal and you will have to write a bit of code to make it get the right number. I'll get to it in a future update.


If you have any suggestion for what you'd like to see next ask away and I'll try and do it if I can.


As usual, documentation and plugin in the attachments of the main post or on pastebin!


Full list of new commands:

armor_param(id,paramId) // will return the bonuses provided in paramId for armor Id
weapon_param(id,paramId) //see armor
actor_change_sprite(actorId, name, index) //wil change the sprite of actor actorId to [sprite]. Useful for changing by name.
//I used it in ACE to make the equipment visible on screen
actor_change_face(actorId, name, index) // changes the face
actor_change_battler(actorId, name) // changes the battle sprite
enemy_change_hp(enemyIndex, n)
enemy_change_mp(enemyIndex, n)
enemy_change_tp(enemyIndex, n)
enemy_state_add(enemyIndex, n)
enemy_state_remove(enemyIndex, n)
enemy_recover(enemyIndex)
enemy_appear(enemyIndex)
enemy_transform(enemyIndex, n)
enemy_anim(enemyIndex, animationId, bool, delayN)
turn_count()
enemy_collapse(enemyIndex)
enemy_hp(enemyIndex) // returns the value of enemy hp
enemy_mp(enemyIndex)
enemy_tp(enemyIndex)
enemy_states(enemyIndex) //returns the sates affecting an enemy in an array
enemy_stateC(enemyIndex, stateIndex) //returns true if enemy is affected by state stateIndex
enemy_xy(enemyIndex, x, y) //Changes the position of the sprite of the enemy
enemy_angle(enemyIndex, angle)
enemy_scale(enemyIndex, x, y)
battle_actor_xy(index, x, y)
battle_actor_angle(index, angle)
battle_actor_scale(index, x, y)
// Those last three are meant to be used in a common event called by using a player skill
actor_caster()
actor_target()
actor_last_skill()



Image to show how changing a sprite scale looks:

1nQkz2Z.png

Have fun!
 
Last edited by a moderator:

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
Hello everyone!


Update is out. Two major points:

  • I made sure before taking any code on the internet that a license was provided in clear terms and that it complied with any use. Today, while revisiting my sources, I've found that I cannot find anymore a clear license from where I took the calculations from point in triangle. Thus, point in triangle function is removed from the plugin. You can use the event in polygon instead, for the same effect.
  • While doing this I've realised that I may not have been clear enough on the credit necessities. I've updated the license and credits in the post. If you are using my plugin in your project please update your credits in compliance. The point in polygon algorythm and code (the only function remaining in which part of the code was taken from the internet) both have credit requirements detailed inside the main post. To be clear: I'm using their code in accordance with their license to redistribute, edit, sell, sublicense, etc. and not claiming it as my own. I just thought I should remind you, the user, that additional credit requirements are needed. I already did in my project I just want to make sure no one will be caught off guard.

The overall terms of use haven't changed.


Highlights:

  • A lot of functions aimed at creating and manupilating window to display on the map. That means displaying text, icons, gauges,...
  • Another way to display text on map by using a picture instead of a window.
  • Flash a square in red, green or blue, used in the gif in the opening post, example n*3. (Via picture or window).
  • Return the target actor Id of the last item used by the party, as well as the id of the item.
  • Change an event direction, opacity and movetype.

Also improved code quality. And new documentation in excel format for more readability.


If you have any questions, I'm open as usual. If you prefer the old word documentation instead, let me know and I'll switch it back.


As usual you can find the new script and documentation as attachments on the main post, and the link to pastebin has been updated as well.


Image example:

3OHHNkE.png



List of new functions:

party_last_item() //will return the id of the last item used by the party.
actor_item_target() //will return the id of the target actor of the last item used by the party
texts(id,texts) //creates a picture 812*624, displays it at 0,0 and then writes the texts on it texts = [[x,y,"text"],[x2,y2,"text"],...,[xn,yn,"text]]
flash_square(id,R,G,B,opacity,blendMode) // creates a picture 812*624, displays it at 0,0 and then colors the squares in red green or blue.
//provide the arrays of points like this: R = [[x1,y1],[x2,y2],...,[xn,yn]]
actor_name(id)
event_direction(id,direction) //changes event id direction, 0 for player, inputting no direction argument will return the current direction.
//Direction is 2-4-6-8
event_movetype(id,movetype) //same as direction but for movetype. In order from the drop down menu in event creation starting at 0.
event_opacity(id,opacity) //see above.
part_order(slot,actorId) //puts actor actorId in the target slot, swapping position with who was there.

window_add(id,x,y,width,height) //creates and stores a window inside game variable id.
window_remove(id)
// a bunch of other functions for window management, see attached documentation.



Edit: It seems while updating the documentation I forgot some commands... Whoops.


Here they are:

monster_gold(id) //will return the amount if gold monster (id) gives on death.
monster_exp(id) //see above but exp
monster_note(id) //will return monster (id)'s note
monster_desc(id) //see above but description
monster_param(id,paramId) //Will return the value of monster (id)'s param (paramId).

I'll update the documentation next update.
 
Last edited by a moderator:

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
Hey everyone!


A small update in terms of contents is out, however it fixes some unintended behaviour and should prevent incompatibilities. Please update to the new version if you were using the plugin.


Known: not a bug:

  • From this version on, you'll never be able to use any of these functions anywhere else than in the script call event command.
  • That means not in conditionnal : scrit and not in game variable : script
  • That means you should use the  desired functions in a script call, set a temporary switch and use a regular conditionnal to check the temporary switch.

Sometimes you were able to in the previous version, but this was due to a mistake I made and it shouldn't have happened.


However, don't think of it as a reduced amount of features: the way it "worked" is that I was, unintentionnaly, declaring all those functions as global. Declaring something as global can mean a lot of trouble as far as incompatibilities go. I'm very sorry for the inconvenience, shame on me for making such a basic mistake.


After a lot of checking, there should be no more of that global nonsense.


List of the new functions you can toy with:

actor_sprite(id) //will return : [sprite file name, index]
event_sprite(id,name,index) //will change event [id] sprite to filename [name], index [index]
//if no name or index were given in arguments, it will instead return [sprite name file, index]
party_swap(id1,id2) //will exchange actor [id1] and actor [id2] position in the party
rm_kill() //quits rpg maker without saving anything
actor_states(id) //will return the states affecting actor [id] in an array [stateId1,stateId2,...,stateIdn]
actor_stateC(id,stateId) //will return true if actor [id] is affected by state [stateId]



Have fun! 


And, as usual, if you encounter any trouble using my plugin or have any suggestions, comment or pm me. Updated documentation, link to pastebin and plugin file as attachment in the main post.
 

matthew30903

Veteran
Veteran
Joined
Jun 29, 2014
Messages
84
Reaction score
32
First Language
English
Primarily Uses
RMMZ
A little unfortunate that they cannot be used in conditionals anymore, but comparability is more important and there is a way to assign them to switches so it is no big deal. Thank you for your work on this plugin.
 

Johan Liebert

Villager
Member
Joined
Apr 6, 2016
Messages
12
Reaction score
1
First Language
French
Primarily Uses
Again thank you for this useful script. I would suggest to add a script call which allows us to update windows created.  Something like '' window_update(id) ''  and '' window_update_all''. That will make things easier when we change gauge params  for example or any other contents. 


EDIT: I forgot to ask what are the colors we can use in the script? In gauge for example? I managed to find red and black in addition to the blue proveded in your example. 
 
Last edited by a moderator:

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
Thank you both for your nice replys.


@Johan Liebert Those are very good ideas, unfortunately, while I have an idea on how to do it, it's a lot of work.


Right now, I don't keep track at all of what is inside the window, once you write on it if you want to "update" it you have to delete and remake it. I know it's not very efficient but that's the way I've been doing it too. I'd have to remake the functions, track what contents were added inside the window and update them when prompted...


If I can make it work I'll definitely add it. No promises on the ETA though.


I'll also probably change the way the windows work by storing them all in an array contained in a game variable that you could choose as a plugin parameter. This way it will be easier to have an update all command. Or I'll create a new object to store them and drop the idea of storing them in a game variable entirely... We'll see.


For your other question: It's probably not what you want to hear, but I found them by trying too, blue, red, black, green, orange and pink are the ones I tried.


However you can use this function to make the color you want using rgb:


Utils.rgbToCssColor(255,0,0) //will produce red


I currently use this website to preview a rgb color: http://www.rapidtables.com/web/color/RGB_Color.htm


I'll make a function rgb(r,g,b) next update to facilitate it.
 

Johan Liebert

Villager
Member
Joined
Apr 6, 2016
Messages
12
Reaction score
1
First Language
French
Primarily Uses
Ok that is also how i managed to update my windows anyway. Nevermind . Great work still and thank you for the colors.


Edit: Maybe i missed something but is there a way to display game variables in windows ?
 
Last edited by a moderator:

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
@Johan Liebert


Yes, you can. Example in spoilers below.

MRXSmHK.png



Edit: Please note that as of V0.7 this exact syntax won't work: use window_exists(id) and not RV(id) to check if a window exists.


Further explanation on how the window parameters will work:



//Example of parameters:
3 //will always be 3
RV(id) //will be evaled the first time the window is added and not after.
//This means subsequent calls will always have the same value as the
//one when the window was created or the command processed
"RV(id)" //This will be evaled the first time and all subsequent times as well.
//allowed to update the window.

"Text" //will return an error Undefined : text
"'Text'" //will return the string 'Text'

//So you could call:
window_move(1,"RV(1)","RV(2)")
//Then each time you update the window it will move to the current values inside variable 1 and 2



As you can see I did implement a way to "update" windows.


Well, actually, I just automated the process of destroying and then reapplying all commands, but it works.


Right now I'm struggling with a bug where if you change the size of a window and draw text in it, the text width cannot exceed the original width of the window.


Once that is fixed and I change the window container and since I have some new functions, I'll provide a new version of the plugin.
 
Last edited by a moderator:

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
Hi everyone!


New version is out. As usual you can find the new version pastebin link in the first post and the new help file and documentation as attachments.


What's new:

  • Bugfix: some event related functions could sometimes return improper results if you had holes in your event Ids. (event_x event_y and event_jump)
  • Bugfix: Changing window width should allow you to write text properly.
  • Enemy sprite related commands will now use the same index as all other battle commands.

Because the enemy sprites array isn't properly organized this works by checking their coordinates, so if two of your enemies' sprites have the exact same x and y coordinates it will move the wrong enemy. If this becomes a problem for you, tell me and I'll see if I  can find another way.

  • Updating windows, as suggested. This required some modifications in the way the parameters should be written, and as such might crash your game if you don't read the documentation and update your script calls accordingly. In particular, strings must be provided with double quotes " 'text ' ". Full explanations in the documentation, feel free to point out if the explanations are lacking.
  • The window container has been changed, they will no longer be stored in game variables. This shouldn't impact your script calls.
  • A bunch of new functions, zoom, screen shake,...



Example of new window calls and window updating:

YX6iKq7.png



Ignore Variable 2 and self switch A. They were there for other unrelated testing purposes.



List of new functions:

party_member_id(index) //returns the id of the actor in position (index), indexes start at 0 for the party leader
party_member_name(index) //see above but name
next_encounter() //returns the steps necessary to the next encounter
map_Id() //returns the current map Id
zoom(x,y,scale,duration) //zooms to point (x,y) by a factor of (scale), over (duration)
clear_zoom() //resets zoom
shake(power,speed,duration)
clear_shake()
clear_weather()

//window related
window_update(id) //updates window id
window_update_all() //updates all windows
window_exists(id) //returns true if window id exists
rgb(red,green,blue) //will return a usable color for windows (gauge, text or filling) the parameters must be within range 0-255.


//in battle
enemy_id(index) //returns the id of the monster at position (index)

//to call in a common event called by a skill
actor_caster_id() //returns the id of the casting actor



Have fun!
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

Just laid down a sick nasty new post in the MagiCats! Infinite Sadness thread! Lemme give ya a big ol' hug for it.

bg6.jpg
Wheel of Attacks.png

MORE GAMBLING THEMED ATTACKS!

I AM UNABLE TO STOP!
Is it ok to repost stuff that i've posted to threads in the status feed?
If so, here's art of Shiloh, the main protagonist of the game i'm making:20220807_181702.jpg
They are meant to be ambiguous in gender, like Frisk from Undertale or Gogo from FFVI. I haven't decided what their age will be yet. Any ideas?
Please comment what you think about the art and design!
ScreenShot_8_10_2022_7_15_21.png
Looks like Mike's got a new party member in Robbi...

Calf survival story with a happy ending.

Forum statistics

Threads
124,461
Messages
1,163,837
Members
163,282
Latest member
Wintt
Top