Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 11-19-2014, 12:37 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 86,992
Kyttias is on a distinguished road
Default Untradeable Single Species: How?

How would I go about making a species be untradeable? Basically, I'm going to give the user a free pet at the start, they only get one of this special kind, and it needs to be untradeable and unable to be pounded, because I'll be calculating their progression (for story-driven events) based on the level of that one, special pet. If they were to lose it... my system crumbles.

Do I just add a column in the database to hold a marker saying if its the starter pet? And when its first adopted from the special page, it will get that marker? I could always set it to 'not for trade' on its creation, right? And then check if its the starter pet, and disappear away the option to change its trade status, and the link to pound it, from the pet management page?

Or is there a better way?
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #2  
Old 11-19-2014, 01:54 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,260
IntoRain is on a distinguished road
Default

Yup, it's like that yes ^^ If you add a column to check if it's the starter pet, you can use just that variable to prevent the pet from leaving. Basically in every function that might try to change its trade status, pound it, etc. you need to check if it's the starter pet. Don't just make the options disappear btw, some people might try to access the link manually, so the verification has to be there before the database updates too
__________________


asp.net stole my soul.
Reply With Quote
  #3  
Old 11-30-2014, 02:25 PM
ilrak ilrak is offline
Goldfish Fanatic
 
Join Date: Aug 2014
Location: Utah
Posts: 57
Gender: Female
Credits: 11,544
ilrak is on a distinguished road
Default

Ooh this is a cool idea! If you're adding the column to the database, would it be INT or VARCHAR? I think I want to use something like this on my site too (since you start out with two fish to start your school).
Reply With Quote
  #4  
Old 11-30-2014, 04:49 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,260
IntoRain is on a distinguished road
Default

Quote:
Originally Posted by ilrak View Post
Ooh this is a cool idea! If you're adding the column to the database, would it be INT or VARCHAR? I think I want to use something like this on my site too (since you start out with two fish to start your school).
Anything works, but I woudn't use varchar. If you don't want/can't use boolean, I'd go with an enum of true and false or an int (1 or 0)
__________________


asp.net stole my soul.

Last edited by IntoRain; 11-30-2014 at 04:53 PM.
Reply With Quote
  #5  
Old 12-01-2014, 03:50 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,587
Hall of Famer is on a distinguished road
Default

Well an easier way is to do something similar to the items. For items they may be tradable or untradable depending on a value set in the database column 'tradable' in table prefix.items. The trade machine will scan for items that are not tradable, and block trade if this happens. Look for the code at trade.php and related class files such as class_trade.php and class_tradevalidator.php. They can give you some hint.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to delete a pet species Cremuex Levier Questions and Supports 4 04-03-2013 10:07 AM
Adopt only one of each species Niku Questions and Supports 1 08-13-2011 02:51 AM
Species Names Beaux Questions and Supports 5 05-09-2011 04:07 PM
Is it possible not to display the species name of the adoptable in adopt center? Hall of Famer Questions and Supports 3 03-07-2010 06:54 PM
Single error when loading the page. Squiddle Questions and Supports 1 09-06-2009 03:27 PM


All times are GMT -5. The time now is 06:18 PM.

Currently Active Users: 456 (0 members and 456 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636