RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[XP] How to change an ITEM's common event. any time in the game? [solved]

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 67
RMRK Junior
Originally my plan is to create another menu for QUEST. but it is lot of scipting and I can't find something like that.
so i used an ITEM name QUEST BALL.
What I want is when the player  talk to an NPC, he'll get a quest from it. And if the player want to see his quest, he can always look at the QUEST BALL to see what is the goal of the quest. here is an example:

NPC: Get me 3 pcs of feather from the forest.
so that's the quest, and if the player want to see again what he should do he can use QUEST BALL from his menu and this will display:
"Get 3 PCS of feather from the forest"

and when the quest is finished and the player gets another quest. the common event of the QUEST BALL will be change for example:
"Quest2: Kill 10 orcs"

Like that guys. I'ts pretty simple but I'm a noobie. so please help me.  :lol:
Thanks in advance!
« Last Edit: August 20, 2011, 01:39:43 PM by kenth21v »

**
Rep:
Level 83
Forget ...

The problem is that items are not saved in the savefile . So , even if you can find a way to change the common event programatically , the next time you save/load the game , the modification will be voided .

use a variable and a lot of "if" in your common event instead .
You can use my scripts freely . but not for commercial use .
:ccbync:
Don't encrypt your game !!!
Want to give me credit ? Easy ,add me in your game :

**
Rep:
Level 67
RMRK Junior
Forget ...

The problem is that items are not saved in the savefile . So , even if you can find a way to change the common event programatically , the next time you save/load the game , the modification will be voided .

use a variable and a lot of "if" in your common event instead .
i don't really get what you said, "items are not saved in the savefile". then how can the items in the game will be collected? well, don't need to asnwer that. your idea is cool. I'll just gonna use variable for the common event and quest.
thanks mate !  :)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
What he means is that they aren't saved as individual instances, but instead how many you own of an item is simply saved as a number in a hash. However, the stats of all those items are the same since it doesn't save each item's individual data and instead just loads it from the data file everytime you start the game. Therefore you can't change the common event ID of the item and expect it to be saved and carried over to the next time you load the game.

That said, it wouldn't actually be hard to do this with a script since you don't need them to be individualized. All you'd have to do is make a Table in Game_System (or some other class that's saved) with each value being the common_event_id of the corresponding item id. Then you would overwrite the common_event_id method in RPG::UsableItem and just have it return the value from that table instead.

However, the variable and conditional branches dricc recommended is the far superior solution.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
You could make a method in Game_System that changes the common event
Code: [Select]
def change_item_ce(type, id, common_event)
  $data_skills[id].common_event = common_event if type == :skill
  $data_items[id].common_event = common_event if type == :item
end
but I'm not in the state to test stuff right now. I don't even have VX or XP open. I really don't think that would work anyway.
But if it's solved, then it doesn't matter. Using variables is a good idea.
it's like a metaphor or something i don't know

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
It wouldn't work for the reason dricc identified.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
:awareofthis:
it's like a metaphor or something i don't know