EOSERV Forum > EOSERV > How to set Default Values On SQLite
Topic is locked.
Page: << 1 >>
How to set Default Values On SQLite
Author Message
Post #89592 How to set Default Values On SQLite

I am using Apollo's Vodka server and SQLite database that comes with the server. I was trying to make some database felds start with a default value. Before you all think that i didnt search forum or didnt google i say i did all these i read all posts carefully and need more help. I want more detailed help if someone know. Or tell me if that i want to do is possible or not.

More specifically i want each time i start the server a quest already running for new players. That means i want my quest field got a default value for new players. I tried to edit install.sql, imported and created a new database. But the quest field didn't take the default value i want. Was empty like the original database. I want to know if i have to write the default value with a specific way, which i dont know him. Is it possible to make a default value for a field like quests? Because the type is TEXT. Here is what i wrote on install.sql:


`paperdoll`        TEXT             NOT NULL,
    `spells`         TEXT             NOT NULL,
    `guild`          CHAR(3)        DEFAULT NULL,
    `guild_rank`  INTEGER        DEFAULT NULL,
    `quest`         TEXT             DEFAULT '1,START;', <--- i entered that where "1" is the quest id and "start" is the state i want to begin with.
    `vars`           TEXT             DEFAULT NULL,


Do i have to type it with a diferend way? like with () or " " instead of ' ' i put? Is this possible at all or/and do i have to change something else?

Thank you very much for any ideas,opinion or help you might post.

14 years, 5 weeks ago
Post #90119 Re: How to set Default Values On SQLite

You typically can't have a default value for text fields; you have to specify what you want manually in the INSERT query.

14 years, 4 weeks ago
Post #90124 Re: How to set Default Values On SQLite

 `quest`         TEXT             DEFAULT NOT NULL, 
Edit your current quest query to this ^

 INSERT INTO characters (`quests`)
VALUES ('1,START;');

Insert this into your install.sql near the bottom-ish I would gather?

Would work I think?

Don't quote me on that but I think that would work, I'm sure I'll be corrected if I'm wrong.


---
If money doesn't grow on trees, then why do banks have branches?
14 years, 4 weeks ago
Post #90154 Re: How to set Default Values On SQLite

Why go to all of this trouble to add a starting quest that about 95% of players aren't going to take the time to notice is even added to their quest progress list. Put an NPC at your first map and give them a little background story on your game/welcome them. Even better, don't let them leave the first map until they have talked to the quest NPC. Honestly, I can't think of one reason a quest needs to be active when a character is created. That is why I omitted "starting quests" from Vodka in the first place.

14 years, 4 weeks ago
Post #90168 Re: How to set Default Values On SQLite

Scot: Thank you very much for your time scot. I appreciate but it dont works. It give me an error says: Error importing data at line 26718601

It builds normally all database but quest field is still empty. I might search more to see if that is possible but i think its not worth to spend more time to that. Well thanks again.

Apollo: That exactly i am doing. I have Npc's that dont let you leave the map if you dont speak with them, i got quests running and the player dont know about them (only on Quest tab) that help the game become more intresting. Diferend death spawns, changing skins and go back to the players default, quests to make riddle games etc. My server is tottaly based on Quests and i love making states looping so i would like to have one more option to have already started quests. I guess i ll follow what you said for once again. Thanks for everything.

14 years, 4 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > How to set Default Values On SQLite