Good news! To provide faster support and grow the community, we'll be changing the forum to "Read Only" and turn to Discord instead for support.
Join here: https://discord.gg/zjNj5zZ

Realtime Item changes

User avatar
silvermurk
Posts: 67
Joined: Wed Jul 06, 2016 8:22 am

Realtime Item changes

Postby silvermurk » Thu Jul 20, 2017 11:41 am

As far as i understand- to use an item trou IPro - i need to register it in database.
If i have a script (ex. armor) attached to an item that gets it`s values in realtime (like when identified)
can i use some method to add this item to database?
Es an example - i have a prefab equipableitem with Amor script that has armor property armor with value of 10.
Script has armor property randomized in range 10-20 on Awake.
So i spawn Aror prefab to scene, and when Runtime begins it gets new armor value.
Is there a way to sabe Runtime armor and keep it as equipable item for Ipro ?
Thanks)

User avatar
jjahuijbregts
Site Admin
Posts: 2091
Joined: Wed Apr 22, 2015 7:25 pm
Contact:

Re: Realtime Item changes

Postby jjahuijbregts » Sat Jul 22, 2017 2:36 pm

silvermurk wrote:As far as i understand- to use an item trou IPro - i need to register it in database.
If i have a script (ex. armor) attached to an item that gets it`s values in realtime (like when identified)
can i use some method to add this item to database?
Es an example - i have a prefab equipableitem with Amor script that has armor property armor with value of 10.
Script has armor property randomized in range 10-20 on Awake.
So i spawn Aror prefab to scene, and when Runtime begins it gets new armor value.
Is there a way to sabe Runtime armor and keep it as equipable item for Ipro ?
Thanks)


You can add the base item to the database and then randomize the stats are run-time. THey're already saved and loaded by default, so all you'd have to do is generate them once (before serialization, so serialization will overwrite it if there's already existing data available). Or you can only generate the random stats if no serialization data is available to begin with.

User avatar
silvermurk
Posts: 67
Joined: Wed Jul 06, 2016 8:22 am

Re: Realtime Item changes

Postby silvermurk » Sun Jul 23, 2017 9:56 am

And I thought i'd need a custom serializer.. ))
Your asset is amazing. Cheers)
And thanks for reply)

nrvllrgrs
Posts: 12
Joined: Wed Apr 20, 2016 10:33 pm

Re: Realtime Item changes

Postby nrvllrgrs » Fri Jul 28, 2017 9:02 pm

How would one handle runtime changes that affect the name and icon? For example, the base item is a generic armor. At runtime, the system selects a random name and icon for that armor, thereby making it a special type of armor.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest