GSUK'S PROFILE
gsuk
0
Search
Filter
Item Crafting
Thanks for the effort.
I copied it into the original script in the place you said (replacing nothing in the original script), and upon launch I get "undefined method 'on_item_ok'"
I copied it into the original script in the place you said (replacing nothing in the original script), and upon launch I get "undefined method 'on_item_ok'"
Item Crafting
yes. what is the call I should put there? I tried just putting SceneManager.call(compare_crafting_level) at the end of the script (I wasn't expecting success!), and of course I got an error on loading.
Then I can experiment with putting it in different places and see if anything works.
EDIT: Was looking at posts on forums and it seems that you cannot call scripts from other scripts, only functions inside that script. So, I don't know if what I want is going to be possible.
Then I can experiment with putting it in different places and see if anything works.
EDIT: Was looking at posts on forums and it seems that you cannot call scripts from other scripts, only functions inside that script. So, I don't know if what I want is going to be possible.
Item Crafting
All I have is the script in my list below the original crafting script. I didn't know I had to call it. How do I do that? The original crafting script is called with a script in an event: SceneManager.call(Scene_Crafting)
I feel like the compare_crafting_level script has to run alongside that so that it can work for every instance of crafting (you can craft several items at once). Do I need to call it within the original script somehow?
I feel like the compare_crafting_level script has to run alongside that so that it can work for every instance of crafting (you can craft several items at once). Do I need to call it within the original script somehow?
Item Crafting
Thanks. I tried that, putting the values in, but still nothing happening. the puts code isn't displaying anything in my console and the variable is not increasing.
I changed the value of 320 to 431, as that's the first of my level variables. 431–481 is the range (50 levels), but even if I can just get it working for the first level, I can adapt that! I changed to 'for id in' part from 0 ... 10 to 0 ... 50. Why does it start at 0 (I tried 1, and still nothing happens)?
the rest of my script is just the original "if rand" part that I used before that worked (increases the variable 63 by 1 with a random chance).
My whole script:

https://imgur.com/a/5V3n8W8
I changed the value of 320 to 431, as that's the first of my level variables. 431–481 is the range (50 levels), but even if I can just get it working for the first level, I can adapt that! I changed to 'for id in' part from 0 ... 10 to 0 ... 50. Why does it start at 0 (I tried 1, and still nothing happens)?
the rest of my script is just the original "if rand" part that I used before that worked (increases the variable 63 by 1 with a random chance).
My whole script:
https://imgur.com/a/5V3n8W8
Item Crafting
Thanks! I'm trying it at the moment. Currently, nothing is happening (I'm not getting skill ups), but I think it's because of the "for id" and "val" parts at the top – I don't know which values I should substitute in here depending on the switches/variables I'm using.
Item Crafting
Would this work for any crafting item of any level? your example shows switches 421–431, so would that only work for level 10?
I think I might be making this more complicated / requiring heavy scripting.
I think I might be making this more complicated / requiring heavy scripting.
Item Crafting
Sorry about the mangled code.
How would I make the condition to check to level against the item/crafting_switches?
For example:
To make a Bone Shield, you need to be have crafting level 2. The item is tagged with <craft switch:422> which is the level 2 switch. If this switch is off, the item doesn't appear in the crafting window.
I also have a variable ($game_variables) which ranges from 1–50 to designate the player's crafting level. When the variable is 2, the switch 422 turns on, making the Bone Shield item available in the crafting window. When the variable is 3, switch 423 turns on (making level 3 items appear), and so on.
At level 1, the player can currently only craft level 1 items, which is fine. But when the player reaches, say, level 10, I don't want them to be able to continue increasing their crafting level by making level 1 items.
If the player has crafting level 10, all ten switches (421–431) are ON, because they can still craft items of any level 10 or lower.
So I guess the comparison I need is something like "if the item craft level (the item.crafting_switch) is 4 or more levels lower than the player's crafting level, then skip the 10% chance of skill up.
Example:
Player crafting level is 10 (switches 421–431 are ON, and variable 63 = 10).
Item crafting level is 5 (craft switch:426 in item tag).
No chance to skill up in this case.
I don't know how I'd go about comparing a variable to a switch.
How would I make the condition to check to level against the item/crafting_switches?
For example:
To make a Bone Shield, you need to be have crafting level 2. The item is tagged with <craft switch:422> which is the level 2 switch. If this switch is off, the item doesn't appear in the crafting window.
I also have a variable ($game_variables) which ranges from 1–50 to designate the player's crafting level. When the variable is 2, the switch 422 turns on, making the Bone Shield item available in the crafting window. When the variable is 3, switch 423 turns on (making level 3 items appear), and so on.
At level 1, the player can currently only craft level 1 items, which is fine. But when the player reaches, say, level 10, I don't want them to be able to continue increasing their crafting level by making level 1 items.
If the player has crafting level 10, all ten switches (421–431) are ON, because they can still craft items of any level 10 or lower.
So I guess the comparison I need is something like "if the item craft level (the item.crafting_switch) is 4 or more levels lower than the player's crafting level, then skip the 10% chance of skill up.
Example:
Player crafting level is 10 (switches 421–431 are ON, and variable 63 = 10).
Item crafting level is 5 (craft switch:426 in item tag).
No chance to skill up in this case.
I don't know how I'd go about comparing a variable to a switch.
Item Crafting
Perfect!
I actually changed it a bit so it uses a variable instead of switches to track the level:
class Scene_Crafting < Scene_CraftBase
#--------------------------------------------------------------------------
# * Item
# remove ingredients, add new item to inventory
#--------------------------------------------------------------------------
alias gsuk_on_item_ok on_item_ok
def on_item_ok
gsuk_on_item_ok # call original function
# extra stuff here
print("do a thing\n")
if rand < 0.1 # 10% chance
$game_variables = $game_variables + 1 # add 1 to lvl
end
end
end
Thanks a lot for the help! I just need to figure out a way to display a message on level up. Will end up doing it through a complicated event, probably. :D
EDIT: I figured out the message display.
There's one last thing that I'd like to do, but I feel like it would be taking advantage a little to ask, so feel free to say it's not possible / too much effort, but a problem I now have is that the player can level up by crafting any item. Ideally, the player wouldn't be able to increase their level by crafting an item that is too simple for them. The items can't be assigned crafting levels as such in the script, but they do require certain switches to be on in order to craft the item (in my case, the player has to have a certain crafting level in order to be able to make various items). I don't know if it's possible to set it up somehow that if a player's crafting level is, say, 10, they can't increase their skill by crafting a level 1 item (requiring the lowest level skill switch being on).
I actually changed it a bit so it uses a variable instead of switches to track the level:
class Scene_Crafting < Scene_CraftBase
#--------------------------------------------------------------------------
# * Item
# remove ingredients, add new item to inventory
#--------------------------------------------------------------------------
alias gsuk_on_item_ok on_item_ok
def on_item_ok
gsuk_on_item_ok # call original function
# extra stuff here
print("do a thing\n")
if rand < 0.1 # 10% chance
$game_variables = $game_variables + 1 # add 1 to lvl
end
end
end
Thanks a lot for the help! I just need to figure out a way to display a message on level up. Will end up doing it through a complicated event, probably. :D
EDIT: I figured out the message display.
There's one last thing that I'd like to do, but I feel like it would be taking advantage a little to ask, so feel free to say it's not possible / too much effort, but a problem I now have is that the player can level up by crafting any item. Ideally, the player wouldn't be able to increase their level by crafting an item that is too simple for them. The items can't be assigned crafting levels as such in the script, but they do require certain switches to be on in order to craft the item (in my case, the player has to have a certain crafting level in order to be able to make various items). I don't know if it's possible to set it up somehow that if a player's crafting level is, say, 10, they can't increase their skill by crafting a level 1 item (requiring the lowest level skill switch being on).
Item Crafting
Hi Coelocanth!
Thanks for getting back soooo quickly – I wasn't sure if anyone would respond. I'm really not great with the whole scripting thing (understatement), so I have a couple of questions, if you'll indulge me:
1. Where do I put this script? Separately, or somewhere in the original script?
2. # extra stuff here
print("do a thing\n")
I don't know what extra stuff I'd need to put there, and how to add the 10% chance of changing the switches. I guess I'd need some kind of branch that checks which level switch is on and then turns the switch+1 on if the 10% chance hits (but not past the max level).
Thanks for any help!
Thanks for getting back soooo quickly – I wasn't sure if anyone would respond. I'm really not great with the whole scripting thing (understatement), so I have a couple of questions, if you'll indulge me:
1. Where do I put this script? Separately, or somewhere in the original script?
2. # extra stuff here
print("do a thing\n")
I don't know what extra stuff I'd need to put there, and how to add the 10% chance of changing the switches. I guess I'd need some kind of branch that checks which level switch is on and then turns the switch+1 on if the 10% chance hits (but not past the max level).
Thanks for any help!
Item Crafting
Really enjoying using this script.
I want to make it so that my blueprints/recipes have levels. A level 5 Smith can't make an item using a blueprint higher than level 5. Is there a way to have a chance of leveling up each time you craft an item? I don't want to add that to the event because you could feasibly just use the furnace and not attempt to make anything.
I don't think this functionality is coded into the script, but maybe there's a way of using switches? My Smithing Level is simply a series of switches (so Level 1 is switch #421, Level 2 is #422 and so on). Would be good to either add a number to a variable each time you craft something, and when that number reaches a certain value, the level increases (turns next level switch on), or to have a random chance of turning the next switch on each time you craft.
Currently, you can't use a blueprint until the appropriate level switch is on (using craft switch:x), but I can't think of a way to actually turn those switches on after crafting.
Many thanks for any ideas/suggestions!
I want to make it so that my blueprints/recipes have levels. A level 5 Smith can't make an item using a blueprint higher than level 5. Is there a way to have a chance of leveling up each time you craft an item? I don't want to add that to the event because you could feasibly just use the furnace and not attempt to make anything.
I don't think this functionality is coded into the script, but maybe there's a way of using switches? My Smithing Level is simply a series of switches (so Level 1 is switch #421, Level 2 is #422 and so on). Would be good to either add a number to a variable each time you craft something, and when that number reaches a certain value, the level increases (turns next level switch on), or to have a random chance of turning the next switch on each time you craft.
Currently, you can't use a blueprint until the appropriate level switch is on (using craft switch:x), but I can't think of a way to actually turn those switches on after crafting.
Many thanks for any ideas/suggestions!
Pages:
1













