Note Editor Script Request

Status
Not open for further replies.

Killok

Veteran
Veteran
Joined
Jul 30, 2014
Messages
52
Reaction score
1
First Language
English
Primarily Uses
Can someone help me with making a Common event script that will clear actor 001's note description then change it to a string that is determined by (X) + a variable + (Y)? (variable ID 0001)

Ex: X= asd

Variable  = 123

Y=Z

Actor note change upon running script would look like asd123Z
 

Killok

Veteran
Veteran
Joined
Jul 30, 2014
Messages
52
Reaction score
1
First Language
English
Primarily Uses
these changes need to be save file specific
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
I don't know what you're wanting to do with that, but changing note tags, especially for the Actor or Class objects is not a good idea. 

Many, many scripts use those note tags, so It's probally best you don't mess with them. The odds are overwhelming you'll want to use a script that requires those note boxes, so I would strongly advise against using a script that ruins it.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Killok, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Can you explain WHY you are changing it? Changing database items on the fly is generally not a good idea (they are meant to be static, unchanging, and do not get saved with your progress), and there are usually better ways to achieve things.
 
Last edited by a moderator:

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
Zoltor, the only reason it would ever be a "bad idea" to change the note tag contents of an Actor is because most script authors don't actually bother checking what the value of the note tag is -- instead, they assume that the value won't change and cache the information. For some reason, they assume that this will bring some "performance benefit" over making a call to the note method which -- at its absolute worst -- generates a single string which will most likely either be used or garbage collected.

Compared to the egregious abuse of iterations, for loops, poor Bitmap management and overall slipshod programming I've seen from the majority of the scripting community, generating a single string every once in a while hardly seems like a problem.

By the way, Killock, the answer is a very simple script call.

$game_actors[0].note = "asd#{$game_variables[1]}Z"This doesn't mean that scripts will automatically be aware of the change and use it, though -- in fact, it's extremely likely that they won't simply due to the way most script authors write their scripts, as I explained above. Try it, but I can almost guarantee you that it will not work without modifying whichever script is loading the note tag information for use.

Also, Shaz, the changed note tag contents will be stored in the save file -- after all, the note tag is simply an instance variable.

Edit: I also don't have Ace open, so I could be completely wrong about the details of how to set the note (I can't recall how Ace stores the information from the database in an instance of Game_Actor). If anyone else sees this and notices that it's incorrect, please provide the correct script call.
 
Last edited by a moderator:

Killok

Veteran
Veteran
Joined
Jul 30, 2014
Messages
52
Reaction score
1
First Language
English
Primarily Uses
I apologize for double posting, it wont happen again, I have a custom script that adds battler graphics to actors duing battle this script uses the a value input in the note tag to determine what graphic to use for each actor, however I am trying to implement a custom armor system as well, so I need the tag to be versatile, If the custom battle script could be edited to load the graphic file from a different area such as the description box that would work as well.

http://forums.rpgmakerweb.com/index.php?/topic/4811-cps-battle-engine/ here is the link to the battle script I am using- I have it set to style 3
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
@Zoltor im talking about the note box in the bottom right of the database, under actor, it is originally left blank, i only want to change that blank spot but from in game.

http://blog.rpgmakerweb.com/announcements/ace-preview-traits/

right under the green 'trait' area
I know, and probally around 1/3 of the scripts out there, use it.

The most common use for example, is for a custom equip slot script(due to the fact that the default is so basic), which will effectively use up that entire box..
 

Killok

Veteran
Veteran
Joined
Jul 30, 2014
Messages
52
Reaction score
1
First Language
English
Primarily Uses
@Solistra im in love with you

Edit: partially, it was a no go, getting an error in Game_Interpreter line 1411 expecting $end

Note: this is what I have it as

$game_actors[0].note = "battler[#{$game_variables[1]}]"
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
@Solistra, it doesn't work.


note is a property of the RPG::Actor object, not of the Game_Actor object.


You try that code, you'll get an error saying note is not defined for Game_Actor.


You change the code to $game_actors[1].actor.note it refers back to the $data_actors object which DOES have the note property. This is NOT saved with the save file. Run the code, save the game and close it, rerun and resume the saved game, and the note will be exactly what it was at the start.


@Killok, did you search a bit? I know people have asked for note data to be changed in the past, and possibly for that very script. It requires not only the ability to change the note contents, but also to save it, AND to make sure the script looks at its value each time and not just at the start of the game (or of the battle, if you happen to want to change the graphic mid-battle).
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Zoltor, the only reason it would ever be a "bad idea" to change the note tag contents of an Actor is because most script authors don't actually bother checking what the value of the note tag is -- instead, they assume that the value won't change and cache the information. For some reason, they assume that this will bring some "performance benefit" over making a call to the note method which -- at its absolute worst -- generates a single string which will most likely either be used or garbage collected.
I don't bother checking for it because I don't recommend anyone try to use a note to store or changes values during the game.


You're likely going to either do it wrong, or mess up someone else's notes in the process. Because the note is unstructured, you really have no idea what's going to go in there, or how someone might want to use it.


Granted, if your own note-tags are sufficiently well-structured and unique enough, then you could possibly accurately pluck out certain values and sub in new ones, but in general that doesn't seem like something that is worth pursuing when there are easier ways to provide the same functionality for users.
 
Last edited by a moderator:

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
@Solistra, it doesn't work.

...

You change the code to $game_actors[1].actor.note it refers back to the $data_actors object which DOES have the note property. This is NOT saved with the save file. Run the code, save the game and close it, rerun and resume the saved game, and the note will be exactly what it was at the start.
Thanks for the correction -- as stated, I don't have Ace open at the moment and was essentially reciting from memory. Honestly, I could have sworn that I tested this at some point and had the data persist, but that could very well be due to my own modifications to things.

I still stand by my previous points about note tag caching, though.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yeah, I think I discovered this when I was writing my dynamic features script - that SOME stuff on Game_Actor has to actually go back to the $data_actor object. So while you can make some changes that automatically get saved, there are other things you can't change, or if you do you have to make further changes to have it saved.


If you ran it and it persisted, it MIGHT have been that you didn't actually close the game. The $data... arrays are populated right at the start and are not refreshed when you return to the title screen. So going back to the title and then loading the save would show what you'd changed it to. For that reason, going back to the title then starting a new game or loading a different save would also make the new game or the saved game appear as if the data had changed for it as well.


Rather than a new script to change the note tags and have them saved, I'd just change the battle script to get the name from a new Game_Actor instance variable, which will automatically be saved, rather than the actor note. You would still have to ensure the battle script checks each time.
 
Last edited by a moderator:

Killok

Veteran
Veteran
Joined
Jul 30, 2014
Messages
52
Reaction score
1
First Language
English
Primarily Uses
@shaz the script works now but does not change the actor graphic, I am not sure if It is edited to display the correct value though.

Currently: $game_actors[001].actor.note = "battler[#{$game_variables[0001]}]"

$end

 

I need the string to be : battlers[0]

 

I have looked around everywhere from note managers to custom equip scripts nothing has come close to what I am looking for

The closest thing would be a custom equip side view system that uses the character graphic in battle, as to where I strongly prefer the battler graphic, like rpg XP.

 

I used to be able to do this via Events (Gui whore) but I cannot with  this as there is no battler graphics in ace. im currently running midway through a trial and will probably wind up buying it if i fianally get a solution
 

Killok

Veteran
Veteran
Joined
Jul 30, 2014
Messages
52
Reaction score
1
First Language
English
Primarily Uses
my only other option as a solution would be to change the battler style in my custom battle script and use the face graphic set as a battler but it comes to look awfully sloppy as a battle UI and I alo cannot increase the battlers scale using this it just looks plain bad.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I apologize for double posting, it wont happen again
And yet it did, almost straight away. Double posting is posting twice in a row. Just don't do it. Edit your post instead.


I have already told you that it won't work that way, and why it won't work that way. So I'm not going to give you help to make it work, as I've already explained that it's too complicated.


I will say, don't use leading zeros on your numbers when you script.
 

Killok

Veteran
Veteran
Joined
Jul 30, 2014
Messages
52
Reaction score
1
First Language
English
Primarily Uses
I wasnt aware that thats what double posting entailed, I created a topic similar to this about a week ago and figured that was what you were referring to - I have now read the forum linked about rules.

What do you sugjest I do in this case than, can you recommend any other battle scripts of XP style? or can the other script be edited to imply the same Zoom/placement functions that style 3 has to style 4?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Well, yes, we don't like people creating the same topic over and over either. Either bump the old one if it hasn't been filled (as long as your last post is > 3 days ago), or report it if it's been locked and ask mods to unlock it.


I already gave you a recommendation

Rather than a new script to change the note tags and have them saved, I'd just change the battle script to get the name from a new Game_Actor instance variable, which will automatically be saved, rather than the actor note. You would still have to ensure the battle script checks each time.
You just need to find someone who will do it for you.
 
Last edited by a moderator:

FenixFyreX

Fire Deity
Veteran
Joined
Mar 1, 2012
Messages
434
Reaction score
310
First Language
English
Primarily Uses
If I'm reading the script correctly, you should just be able to place this snippet anywhere underneath the battle system in the script editor:

Code:
class Game_Actor  attr_accessor :battler_name, :side_battlerend
and then call this from anywhere:
Code:
$game_actors[actor_id].battler_name = "Some Battler.png"# OR$game_party.members[member_id].battler_name = "Another Battler.png"
If seems the side_battler notetag sets the sideview battle graphic. I've added this as well, so call it just like you would battler_name:
Code:
$game_actors[actor_id].side_battler = "Some Other.png"
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Do you need to include the .png?


And would you need to make these calls right at the start of the game, or would it pick it up correctly from the note tag the first time, then you just use the above to change it?
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top