Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Call Script Mailfunction

Doesn't call script work if u use them in a Common Event?? I tested doing a code in a Regulnar even in RMXP that looked like this:

@menu_sprite = Sprite.new
@menu_sprite.bitmap = \
RPG::Cache.picture("Item - (001)")
@menu_sprite.x = 265
@menu_sprite.y = 96

@menu_sprite1 = Sprite.new
@menu_sprite1.bitmap = \
RPG::Cache.picture("Item - (002)")
@menu_sprite1.x = 265
@menu_sprite1.y = 121

etc

and it works fine in a regular event.. tho when I put it in a common Event the pictures vanish after a few secounds :S Anyon know the reason for this or maybe even an solution for me?
 
Is there a way to avoid that so I can delete it my self when the time comes? I actully need this code to get my menu system more advanst :/

EDIT: @menu_sprite5.bitmap = nil which I use to clean the screen has a delay for 5 sec or so also :/ how come it doesn't delete them directly :(
EDIT: Hmm This delete code ain't very useful :I Could use something the cleans the screen or the text I want that doesn't make to much noice if the text Im deleting don't exist right now :I
 

EOG

Member

There is not any way(I know) to make Sprite update every frame while Sprite was called from Common Event without editig code in Script Editor. There are few other ways
In script editor add before Main
Code:
 

class Scene_Map

  alias old_update update

  alias old_main main

  attr_accessor :to_upd

  def main

    @to_upd = []

    old_main

  end

  def update

    old_update

    for i in @to_upd

      i.update

    end

  end

end

 
To show Sprite do that in event call
Code:
 

@menu_sprite = Sprite.new

@menu_sprite.bitmap = \

RPG::Cache.picture("dziwny_las")

@menu_sprite.x = 265

@menu_sprite.y = 96

$scene.to_upd << @menu_sprite  

 
To delete Sprite
Code:
 

a=$scene.to_upd.index(@menu_sprite)

$scene.to_upd[a].dispose

$scene.to_upd[a] = nil

$scene.to_upd.compact!

 
Just use build-in puctures commands(They are sprites that are updated every frame)

If you like first way and you do not use Scene_Map for this tell and I'll edit it to what scene you want.
To delete spites it's better to do
Code:
 

@menu_sprite5.dispose

 
It will disappear imidietly
 
Sure lets try that :/ atm I'm trying to use it in this manner

Common Event (1)

Conditional Branch Variable [4975] == -1
Conditional Branch "Down"
Variable [4975] Set -2
"Delete the menu sprite" etc
Call Common Event (2)
Conditional Branch Variable [4975] == -2
Conditional Branch "Up"
Variable [4975] Set -1
"Delete the menu sprite" etc
Call Common Event (2)


Common Event (2)

Conditional Branch [Potion] in inventory
Call script: Show Picture called (in this case Item - (001) )
Conditional Branch [Hi-Potion] in inventory
Call script: Show Picture called (in this case Item - (002) )
etc


Seems to be a pain to delete tho cause I guess I would have to make a code like this

Conditional Branch [Potion] in inventory
Call script: Delete @menu_sprite(number)

Now you know how I'm trying to do it I might be totally off I donno :/ Sucks to not be able to script the entire menu but I have to many stuff that RMXP standard menu wont allow :)
 

EOG

Member

It will be easer for me to write a whole new menu script for you just send here what you need in there and some pictures how you want it to look.

Heres demo of what you want to do by common events(it's really hard work to do if you have lots of items). I recoment you writeing whole new Menu system.
DEMO
 
Well My menu is rather juicy if you know what I mean I can send you some pictures maybe you'll see that it might not be so easy :) For starters I have 3 main stats - HP (Health up to 9999) - MP (Magics up to 9999) - SP (Skills up to 100/150 if u have acc on)

That's on issue and another is that I use not 1 accessory but I have 3 diffrent kinds :/
Amulet's & Rings
Charms
Necklaces
Like the Picture there :P Need the background and the Item List isnt in that foto either ^^

I can easly code this with Common Events, Variables, Pictures etc (But the 50 pictures aren't to make it 100% Perfect :) Can still do a fairly good system but then I would have to use only current amount of HP/MP/SP in numbers

Example: Player 1 Has |_____ | <--- Bar 60% ish and 750 HP instead of 750/1000
Picture isn't 100% Correct :P It's just a screenie from what I've manage to code to this point.

EDIT: Wops forgot to ask if it's possible to code a menu with the use of variables? Like Im using right now Variable[4001]Player 1 Current HP, Variable[4001]Player 1 Maximum HP etc

I kinda use 7 Base stats for Str, def etc but RMXP only allows me to control 4 :/
 

Zeriab

Sponsor

You don't need to update sprites every frame.
In fact, you shouldn't unless there is a need.

The Garbage Collector does not remove sprites which haven't been updated for some time. Instead it frees objects which you have no reference too. (Either directly or through any number of other objects)
It does this at its own leisure. You can force the garbage collector to run with GC.start, but it is not generally not advisable since its usually more efficient to let do it by itself.

When you call a common event an interpreter is created for interpreting which is discarded afterwards. After some time the garbage collector will remove it.
For map events there is an interpreter for each parallel process and a main interpreter for dealing everything else. The parallel processes change from map to map, but I don't think the main interpreter does.

If I am right then using class variables (@@) rather than instance variables (@) will prevent the sprites from disappearing when using the script call in a common event.
 
Actully I don't normally use scripts at all :/
Normally I use the Variable command that you have in events rather then script or base stats. Instead of Using the programs Base Stats system I put everything I use I.E. HP.MP,SP, str,spd even which chars u have in party and equipment mostly.

It's just when I put this in Pictures I.E the Show Picture command u have u can have up to 50 pictures but I need to break that and use even more to be able to get my meny the way I want :)

Makes sence or?!
 

EOG

Member

What he said was that you can use
Code:
 

@@menu_sprite = Sprite.new

@@menu_sprite.bitmap = \

RPG::Cache.picture("Item - (001)")

@@menu_sprite.x = 265

@@menu_sprite.y = 96

 
And pictures will not disappear
and you can use
Code:
 

@@menu_sprit.dispose

 
To hide them.

If you want I can code your menu in scrit I've aldedy made equip mentmenu frame you sent.

EDIT:

What bars on right-up corrner does?
 
I'm guessing you mean the first picture ^^
It's for showing in % how much Str, Defence etc you got :) Mostly for looks :) Hasn't desided tho on how do to it :/

Either do it from 0-999 (str) etc
or
From 0-X depending on where in game you are :)

I'm having a kinda diffrent lvling system in my Combat system (which I'm also coding in same manner :)
Instead of exp you have 1/20 chance to inc STR while doing melee dmg and 1/20 chance to increase INT while doing spells and so on :)

Sence I'm doing both a menu and a combat system it's hard for me sence I cant script to use the Base Stats and pretty much anything Base :P and thats why I use tons of variables for stats, gear, skill lvl etc

EDIT: Huh you have? Even with 3 accessories? :/ Hmm.. that script seems to work atleast :) If you can do the menu in script that would be nice should I just make a huge post on how and what the menu will have? :/ If able to script I could even show that Chars have 500/500 HP etc instead of only 500 (Current) :P

NOTE: Is it possible to make some stuff looking for certain variables for info? Sence there's no other way for my Lvling system that I know off atleast sence not only u have 1/20 chance to increase stats u will even have a TP (training point) system that u use 1 TP on desired stats to increase its value :P As you see its a little diffrent kinda system I'm working on :P hehe

I know I'm saying same stuff over and over here ^^ I just want you to know what it is you would get your self into cause it's hard to have one half menu scripted and other half not :P Just tell me and I can link pretty much all info on entire menu :P
 
Okey Here Goes I'll go Menu By Menu :P I'll start with the Screenshots can you then from them tell me which pictures you want me to upload :P I'm kinda using 1 picture / event and I'm guessing you don't rlly need to do that :P Hmm would be easier to put pictures in a map and rar it :I

Base Info

3 Char team
9 Total team members
HP (health) MP (mana) SP (skills) Str (melee dmg) Def (melee def) Force (healing power) Int (magic power) M.Def (magic def) Speed (For ATB in combat) Luck (for crit and other stuff) TP (for skill lvling)

Max HP (9999)
Max TP, Luck (100)
Max SP (100) if Equiped Charm of Technique Max is (150)
Max Rest (999) but would like it to be able to break this limit to maybe 1500 or 2000 (Due to the stats increase from weapons and armors)

Accessory: Amulet & Rings, Charms, Necklaces (Hope it's able to make so you cant put 2 of same kind on like you put on 2 necklaces or something)
Offhand: Arrows and bullets (is it possible to increase the value of these to 999 instead of only 99?) Else I have to figure out a Plan B :)


Main Menu

Pictures

Info
Well not much to tell on this photo :) The Cursor (Red Arrow) Moves back and forth and the background moves also (atm I'm using it as a fog effect hehe) When you click on Skill/Equip/Status The red arrow becomes black&white and another cursor makes you choose which char to enter. If you click on Party Changer you will enter the menu to make you able to change battle chars (should be able to turn off and on at will tho)

Other then that this menu was fairly simple :) Could however add maximum HP/MP/SP in numbers and moce them slightly up som you can read it better.

Item Menu

Pictures

Info
Sence I'm still coding this menu my self the screenshot might be a bit messy :P Anyway First Picture is the First stage of the Item Menu where you choose which Item Class you are to enter.
Explanation:

Item --> Regular Items / Herb Items / Key Items
Weapon --> Weapons / Shields / Orbs / Arrows / Bullets
Armor --> Cloth / Leather / Mail (Can do one menu, I did 3 cause it's easier for the typ of code I use)
Helm --> Cloth / Leather / Mail (Can do one menu, I did 3 cause it's easier for the typ of code I use)
Acc --> Amulet & Rings / Charms / Necklaces
Loot --> 8 diff kinda loot items (could do one entire menu here also) having these for making cash in my game. Like monsters drop Items and u sell them for cash.

As it looks right now the 2nd picture shows a "circle" in the upper left corner which you spin right and left to choose between the list above while the middle Icon is larger means that, that is the menu you will enter and then come to the sub menu. Would be nice to see the first 10 items in these sub menus while spining around (Thats what I'm trying to code atm and thats why it's a bit messy )

If you don't understand the spinning thing I guess I could send my game :I and if it's not possible I can solve that aswell :) Just /poke me if there is and confution or issues :P

Anyway while in sub Menu's You see that the menu changes a bit (picture 3) Which also ain't 100% correct sence the [Posion] etc text under the fotos are gone due to all the Item Quanitiy numbers taking their foto number :( Also the Numbers for Current and Maximum are also missing. In here you press up and down between These Items and Right/Left to change to the other sub menus.

Regular <--> Herb <--> Key Item (like this)

Longer then this I hasnt come but you click an Item from Regular or Herb (which are the only clickable Items in the Item menu) and you get to choose who to use the Item on. Also the black thing behind the faces etc I deleted that part :P Which means the text [Poison] and Prolly even 550/600 need to be black like the Items and Quantity

Skill Menu

Okey nice... I did this part and the forum didnt same it :( Oh well here we go again then...


Okey first of all if it's possible to split spells up to a certain Class like Skill, Fire, Frost etc this is how its gonna work else if not possible tell me and I'll delete some stuff and we make one skill menu instead.

Anyway if able to spell spells into class The middle icon shows which skill menu your in and the other 2 which are both called Fire right know should be smaller just like in the Item Menu :) The text SP will change to MP if its a spell sence pictures indicates skills atm.

Press Left and Right to change between skills and magic classes and normal up and down to go thro the skill menu. When using a healing spell or cleaning spell in skill menu the frame with the Player using the heal will roll away and then the Stats fram like the one in the Item Menu will roll in taking its place and from their choose who to heal :) for the rest it's kinda basic I think
Equip Menu

Picture you already saw noting much to do there but would be nice is the HP/MP/SP was visuable to but not really a priority in here (Only scaled it down sence lack of pictures as always) This would be under the name in that case :) and if you hasn't aready quessed it the Weapon/Armor list will be in the part under the stats.

Like I said in earlier post the Bars in the stats is for the Maximum amount of Stat which would be 999 I guess :) and the numbers beside it is quite obvious alto I think they need to be black aswell :I
Take incount that the faces here are larger (I have all faces in both sizes but I thought maybe sending all pictures in on rar would be easier then uploading a shit load) :/

Also I was thinking when you look at the gear (armor for example) and you have +3 def on you and looking at +6 def gear the Text for Defence would show your current amount +3 in green text and if you lose defence your current - what you lose and text is red.

Don't think theirs much more to say for this menu :)

Status Menu

This Menu will have the basic frame from Equipment but instead of the Weapon/Armor List I will have to paint another Info Bar like the Stats one for Equip but instead of Str etc it will be something like this:

HP Skill LvL (0-100)
MP Skill LvL (0-100)
Str Skill LvL (0-100)
Def Skill LvL (0-100)
Force Skill LvL (0-100)
Int Skill LvL (0-100)
M.Def Skill LvL (0-100)
Spd Skill LvL (0-100)

and you are using TP for increasing these (Don't know if it's possible to increase these directly in the Status Menu but if not I'll just Code a training menu that are accessed from people in towns)
I will also need to add TP bar and text up where the Stats are currently in Equip Menu frame.

Sence this is the Status Menu Seeing your status problems would be nice. If possible to make it jump from one to another if you have more then one status problem would be nice but also not a priority.
Oh and one more thing that aint visable right now the Gear you have on you in the lower left corner will have Icon infront of text in both Status and Equip Menu.

Option Menu


And My favorite Menu :I Sence I don't know 100% what can be done and what's good to have in it except what I already know ^^

Stuff I do know I want is:

Change Battle Music 0 - 1 - 2 - 3 - 4 - 5
Change Menu Music 0 - 1 - 2 - 3 - 4 - 5
Battle Warning On/Off (Turns on/off a switch)

If possible
Change Background Layout (Few diff backgrounds)
Change Background Color (Few diff colors for background)
(Sence I used fog effect it was possible to change color on it)
Background Animation On/Off (Stops the background from moving)

Picture has 2 other things in it atm but ignore them tried it myself and it wasnt that effective

Save Menu + Quit Menu

I'm already using these Menus as script that I found :) Actully why entire menu design is of a resoult of that script but like always I couldn't script my self so I used some Ideas but build the menu my way :)

Party Changer

Hasn't even started painting one sence it hasn't been a priority for my game yet :) Be able to equip and you items its kinda more importaint :P But Basic Idea is to have the 3 battle members lined up on the left screen with all info like HP/MP/SP/Status/Name/Foto and the rest of the party members you can choose on the other side. And in the upper right corner should be the info for the char your cursor are currently hovering over so you know how much HP/MP etc he got.

Will however paint this one last so I'll start to do the other pictures first :)

For more info or questions just ask I'll start making the rest of the menu frames now but this is the basic idea of the entire menu :)
 

EOG

Member

Pictures that I need(empty like this one mainmenuframemain)
- backgroud
- wodregular (fully empty)
- all title strings(example: regular, key items, herbs)
- woditemmenu(fully empty)
- woditemmenu(those pictures an left-upper corner)
- skillmenu(empty)
- wodoptionmenuc(without background)

All you want can be done just need time to programme this

EDIT: And I need font you use. You cand tell it's name or upload it.
 

EOG

Member

If you think there are some pictures that I'll need send them.

I do not understand your quesrion about rar. But if you ask how to make a rar file:
1. Check if you have Winrar installed(Right Mouse Button to on any file and check if you have 'Add to archive' oprtion)
2a. If yes select all things you want to add to rar wile and click this it will make a rar file.
2b. If not download and install Winrar
Go to 2a.
This will make a zip file(a file that is like rar)
1. Select all files you want to make a rar
2. Right Mouse button and select 'Send to => Compressed folder'
It will make a zip file.
 
Well basicly I mean that sending a RAR file with all pictures in it would be easier then to upload them all using imageshack :/ sence if I'm not misstaking you would need more then only the bakgrounds and main frames :)
 
Font is easy :)

ITC Garamond Bold

Item Names: 21 pt
Info Text: 25 pt

For rest text like HP/SP/MP etc I use same but I add som kind of stile on it so I'll sen som pictures with them as Solo photos :)

EDIT: You need the Picture for the Bars also I guess right? is it possible for you to make the bar change color cause I'm using same Picture for all diffrent colored bar :)

Status Menu Design:

Main Frame Empty:
In skill menu I forgot to typ the order I think:

Earth <--> Water <--> Storm <--> Divine <--> Gravity <--> Skill <--> Fire <--> Frost <--> Shock <--> Earth <--> Water

Starting with Skill

I have the smaller pictures and stuff in a mapp atm is there a better way to send em to you or do I need to imageshack all of them :( Icon+Faces+Item Menu Head Text etc are quite a few atm :I

Think I go all pictures there you will need but Ill double check and the go for making the Party Changer Frame.

Also in this map I sent back drops for Bars and text like HP MP SP so if you could use those to add the Stats for health etc on Skill, Status and Equip menu :) Area for it are the upper right corner and in Skill its where the frame if (have the red frame in here to)

Okey here comes the Party Changer :/

I was hoping to have the menu choose order of the black boxes depending on which members are where. Black boxes = Faces of members not currently in your group. Okey let me try to explain I'll make a list of party members first.

Celesta = 1
Selene = 2
Cetus = 3
Serenity = 4
Justin = 5
Regina = 6
Aleria = 7
Ryan = 8
Neo = 9

There... Lets no say only Celesta is in Party and you have the rest of the members in your game. Then Selene should be in slot 1 and Cetus in Slot 2 etc like the list. Let's say you then select Selene as 2nd Combat Char then should will move from Slot 1 to the middle party frame and rest of the group switches order like this: Sence Selene is in group and no longer is in slot 1 then Cetus will take that slot and Serenity in Slot 2 and so on :)

If possible it would be handy to be able to force you to use certain chars in certain points in the game like for some missions you will HAVE to use Celesta as main char but in other you don't even have to use her at all. Same goes with the others ofc.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top