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.
some scripting help

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 81
Monster Hunter
i have a script that shows the player's face in battle and in the script it uses the player's name to find the picture for the battle scene, like this ("HUD_" + actor.name) i would like it to use just the player's ID instead so the player can change names something like this ("HUD_" + actor.id) but that doesn't seem to work any idea what the code for player ID is?

*
Rep:
Level 82
If you have issues accessing a variable that you expect is likely a variable (for example an id number due to it often being a unique value separating one object of the same type to another), it's probably because that variable is not publicly accessible. Looking at the code, this is the case here.

You need to make @actor_id publicly accessible. A quick addition to the scripts:

Code: [Select]
class Game_Actor
    attr_reader :actor_id
end

will do the trick. Accessing it can be done via actor.actor_id

If you wanted to change it to be simply actor.id, you can add this code instead:

Code: [Select]
class Game_Actor
   def id
      return @actor_id
   end
end

These IDs are the same IDs as in the database. So actor 1, by default, is Ralph, actor 2 is Ulrika etc.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

****
Rep:
Level 83
Use "HUD_" + @actor.id.to_s You need to convert the integer into a string to add it to a string class.
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com


*
Rep:
Level 82
Use "HUD_" + @actor.id.to_s You need to convert the integer into a string to add it to a string class.

That's needed too. Completely overlooked the 'used in a string' part. I was a little tired and preoccupied when I was writing that.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

***
Rep:
Level 81
Monster Hunter
thanks guys ^^

EDIT: can't seem to get it work T-T
is it like this?
Cache.system("HUD_" + @actor.id.to_s)

this is how it normaly looks like.
Cache.system("HUD_" + actor.name)

what it does is look for a picture to display which is a picture in the System folder ,with the name "HUD_<player_name>"
i want it to do, is look for a picture to display which is a picture in the System folder ,with the name "HUD_<player_ID>"
« Last Edit: November 28, 2011, 12:13:01 PM by Mitsarugi »

****
Rep:
Level 83
Do you have the variable "@actor" defined or are you using just "actor"?
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com