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.
Useful Scriptlets

0 Members and 1 Guest are viewing this topic.

*
A Random Custom Title
Rep:
Level 96
wah
I guess I understand this. Is it to remove the need to use an extra lines of code to set multiple attributes to a certain thing and remove any "nil" errors? XP

**
Rep:
Level 88
I have a question about the script that lets items teach skills to party members...

Is there a way to make it so it will work on certain party members, but not others? Or only certain classes, if that makes it easier.
Spoiler for My Game Recommendations:
1) Demon Gate --- A great game with a terrific character-relationship system, an engaging story, and plenty of secrets and options for players who wish to be good/evil.
http://www.raizap.com/demongate/

2) Midnight --- A survival-horror game created with RPG Maker XP. Combat plays out in the smoothest running real-time battle system I have seen yet.
http://rmrk.net/index.php/topic,23239.0.html

3) The Healer --- A charming game with beautiful mapping and a fun battle system. One of the few games to use a healer as a main character, and so far it's pulled off well.
http://rmrk.net/index.php/topic,23524.0.html

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
No, there isn't currently, I can add it in if you like.

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
Sorry for the long response. Forgot >_>
I has indeed made to prevent nil errors, or rather make it easier to prevent nil errors.
There can still be errors however and you should not use this way to declare methods with nil as their default. In that case it will be more efficient to use attr_accessor instead.

You can still get errors if you try to do something like this >>2 + "Hello World"<<
For example if the default value is set to 2 and you try to add "Hello World" to the default value.
Still, it should make scripters more aware of the problem.

I personally have an easier time looking over the code and checking the default values than if you have to write the methods out in the normal way.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Update:

Added Stop Animation Actors and removed Skill Teaching Items, as that is now part of the broader script located in the database.

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
Could consider merging my Little Module add-on into this topic?
I think it fits into the topic since you have not said 'my useful scriptlets' ^_^

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
That's a good idea. I'll have to rearrange the topic a little bit, but making it a public topic sounds like a good idea. I like that module addon a lot by the way. I think I might be overusing it at times :P

**
Rep: +0/-0Level 85
I can't get the custom death to work. I made a common event with the following in it:
@>Conditional Branch: [Character name] is [Knockout] inflicted
@>Change State: Entire Party, - [Knockout]
@>Transfer Player: [Map ID] (yadayada), Down
@>
 : Branch End
@>


Perhaps it's wrong?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, make sure you set that common event ID as the one the script uses.

Change:
      $game_temp.common_event_id = 1

to whatever ID of the common event you made is.

*
Rep: +0/-0Level 63
RMRK Junior
Hey there, I'm new here but I've already put this script in and I'm just wondering if there is any way to make it so that actor/environment interactions depend on whose in the lead. Say, a door only opens to a certain character. Any assistance would be appreciated. <3

EDIT: Sorry, I was a bit vague. My question is related to the Change Leader Script.
« Last Edit: November 27, 2011, 02:00:35 PM by mattehdeh »

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
Try playing around with putting the following code in the script part of a conditional branch: (009 bad, 9 good)
Code: [Select]
$game_party.actors[0].id == 42