ALFA Basemod- NWN2 (first version)

For toolset tutorials as well as question and answers.
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

ALFA Basemod- NWN2 (first version)

Post by AcadiusLost »

I've done this one up module style for now, builders can just use Save As Directory to switch it over to directory style.

http://download.alandfaraway.org/downlo ... od_v01.rar

Note that this still requires NWNx4 and MySQL to allow players to log in, spawn system to initialize, etc. Will update it with quest examples and such as time goes on.
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

I'm going to transfer Skullport over to this mod tonight and see if it fixes my quest issues. Thanks AL.
Image
Thangorn
Haste Bear
Posts: 2081
Joined: Fri Oct 01, 2004 1:00 pm
Location: Queenstown, New Zealand

Post by Thangorn »

good stuff acads.. thanks very much :)
On indefinite real life hiatus

[22:52] <Veilan> obviously something sinister must be afoot if a DM does not have his social security number in his avatar name!
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

Gonna hijack so I can fix this problem. I transfereed everything to the basemod, modified the settings script, compiled.

My module loads without a problem, the madchook connects, I can log in fine.

Quests and persistent location continue to fail to work.

Here's the log...I need help on this, so any you guys can give I'll be glad of. I don't know what else to do, so I'm counting on this last ditch plea.
Last edited by indio on Mon Aug 11, 2008 10:05 am, edited 2 times in total.
Image
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

NWNX MySQL Plugin V.0.0.8
(c) 2007 by Ingmar Stieger (Papillon)
visit us at http://www.nwnx.org
(built using mysql-5.0.27 source)

* Log level set to 2 (everything)
* Connecting to server vault.alandfaraway.org
* Plugin initialized.
* Registering under function class SQL
* Executing: CREATE TABLE IF NOT EXISTS `areas` (`ID` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,`ServerID` smallint(8) UNSIGNED NOT NULL,`Name` varchar(64) NOT NULL,`Tag` varchar(64) NOT NULL,`Visits` int(10) UNSIGNED NOT NULL default 0,`X` smallint(5) default NULL,`Y` smallint(5) default NULL,`Z` smallint(5) default NULL,`IsSafe` bool NOT NULL default false,`IsInside` bool NOT NULL default false,`IsNatural` bool NOT NULL default false,PRIMARY KEY (`ID`), UNIQUE KEY (`ServerID`, `Tag`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `cdkeys` (`CDKey` varchar(8) NOT NULL,`IsBanned` bool NOT NULL default false,PRIMARY KEY (`CDKey`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `characters` (`ID` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,`ServerID` smallint(5) UNSIGNED NOT NULL,`PlayerID` mediumint(8) UNSIGNED NOT NULL,`Name` varchar(32) NOT NULL,`Level` tinyint(3) UNSIGNED NOT NULL default 1,`Race` tinyint(3) UNSIGNED NOT NULL,`Subrace` tinyint(3) UNSIGNED default NULL,`Deity` varchar(32) default NULL,`Gender` tinyint(3) UNSIGNED NOT NULL,`HP` smallint(5) UNSIGNED NOT NULL,`XP` mediumint(8) UNSIGNED NOT NULL default 0,`GP` int(10) UNSIGNED NOT NULL default 0,`Wealth` int(10) UNSIGNED NOT NULL default 0,`Ethics` tinyint(3) UNSIGNED NOT NULL,`Morals` tinyint(3) UNSIGNED NOT NULL,`Class1` smallint(5) UNSIGNED NOT NULL,`Level1` tinyint(3) UNSIGNED NOT NULL default 1,`Class2` smallint(5) UNSIGNED default NULL,`Level2` tinyint(3) UNSIGNED default NULL,`Class3` smallint(5) UNSIGNED default NULL,`Level3` tinyint(3) UNSIGNED default NULL,`STR` tinyint(3) UNSIGNED NOT NULL,`CON` tinyint(3) UNSIGNED NOT NULL,`DEX` tinyint(3) UNSIGNED NOT NULL,`INT` tinyint(3) UNSIGNED NOT NULL,`WIS` tinyint(3) UNSIGNED NOT NULL,`CHA` tinyint(3) UNSIGNED NOT NULL,`Location` varchar(128) default NULL,`Damage` smallint(5) UNSIGNED NOT NULL default 0,`Deaths` smallint(5) UNSIGNED NOT NULL default 0,`Status` int(10) UNSIGNED NOT NULL default 0,`IsOnline` bool NOT NULL default false,`IsDeleted` bool NOT NULL default false,`IsPlayable` bool NOT NULL default true,PRIMARY KEY (`ID`), UNIQUE KEY (`PlayerID`, `Name`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `heedspwdata` (`player` varchar(64) NOT NULL,`tag` varchar(64) NOT NULL,`name` varchar(64) NOT NULL,`val` varchar(128) default NULL,`expire` mediumint(8) UNSIGNED NOT NULL default 0,`index` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,PRIMARY KEY (`index`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `ipaddress` (`ID` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,`CDKey` varchar(8) NOT NULL,`IPAddress` varchar(16) NOT NULL,`IsBanned` bool NOT NULL default false,PRIMARY KEY (`ID`), UNIQUE KEY (`CDKey`, `IPAddress`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `item_properties` (`ID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,`ItemProperty` smallint(5) NOT NULL,`Description` varchar(128) default NULL,`IsIllegal` bool NOT NULL default 0,PRIMARY KEY (`ID`), UNIQUE KEY (`ItemProperty`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `logs` (`ID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,`ServerID` smallint(5) UNSIGNED NOT NULL,`CharacterID` mediumint(8) UNSIGNED default NULL,`Event` varchar(32) NOT NULL,`Description` varchar(128) default NULL,`Date` timestamp NOT NULL default CURRENT_TIMESTAMP,PRIMARY KEY (`ID`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `players` (`ID` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,`CDKey` varchar(8) NOT NULL,`Name` varchar(32) NOT NULL,`FirstLogin` datetime,`LastLogin` datetime,`LastLogout` datetime,`Logins` int(10) UNSIGNED NOT NULL default 0,`TimeOnline` mediumint(8) UNSIGNED NOT NULL default 0,`IsDM` bool NOT NULL default false,`IsBanned` bool NOT NULL default false,PRIMARY KEY (`ID`), UNIQUE KEY(`CDKey`, `Name`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `pwdata` (`Name` varchar(64) NOT NULL,`Tag` varchar(64) NOT NULL,`Key` varchar(64) NOT NULL,`Value` varchar(128) default NULL,`Expiration` smallint(5) UNSIGNED NOT NULL default 0,`Last` timestamp NOT NULL default CURRENT_TIMESTAMP,PRIMARY KEY (`Name`, `Tag`, `Key`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `pwobject` (`Name` varchar(64) NOT NULL,`Tag` varchar(64) NOT NULL,`Key` varchar(64) NOT NULL,`Value` varchar(128) default NULL,`Expiration` smallint(5) UNSIGNED NOT NULL default 0,`Last` timestamp NOT NULL default CURRENT_TIMESTAMP,PRIMARY KEY (`Name`, `Tag`, `Key`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `quests` (`ID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,`ServerID` smallint(5) UNSIGNED NOT NULL,`CharacterID` mediumint(8) UNSIGNED NOT NULL,`PlotID` varchar(32) NOT NULL DEFAULT '',`PlotState` varchar(4) NOT NULL DEFAULT '',PRIMARY KEY (`ID`), UNIQUE KEY(`ServerID`, `CharacterID`, `PlotID`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `servers` (`ID` smallint(5) UNSIGNED NOT NULL,`Name` varchar(64) NOT NULL,`IPAddress` varchar(21) NOT NULL,PRIMARY KEY (`ID`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: CREATE TABLE IF NOT EXISTS `spelltrack` (`ID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,`CharacterID` mediumint(11) UNSIGNED NOT NULL,`Class` smallint(5) NOT NULL,`Uses` varchar(128) default NULL,PRIMARY KEY (`ID`), UNIQUE KEY (`CharacterID`, `Class`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
* Executing: SELECT Value FROM pwdata WHERE Name='ALFA Skullport August Beta' and Tag='alfa001_skullport' and `Key`='ACR_TIME_SERVERTIME'
* Returning: 664356000 (column 0)
* Executing: SELECT Value FROM pwdata WHERE Name='ALFA Skullport August Beta' and Tag='alfa001_skullport' and `Key`='ACR_TIME_SERVERTIME'
* Returning: 664356000 (column 0)
* Executing: INSERT INTO pwdata (Name, Tag, `Key`, Value, Expiration) VALUES ('ALFA Skullport August Beta','alfa001_skullport','ACR_TIME_SERVERTIME', '664356720', 0) ON DUPLICATE KEY UPDATE Value='664356720', Expiration=0
* Executing: SELECT pwdata.Name, pwdata.Tag, pwdata.Value, characters.ID, characters.Status FROM characters JOIN players on players.ID=characters.PlayerID JOIN pwdata on pwdata.Name=characters.Name WHERE pwdata.Tag=players.CDKey and pwdata.`Key`='ACR_DTH_LOCATION' and characters.Status = characters.Status | 1
* Returning: #A#sgk_jae_dng_cavel1#X#32.339710236#Y#66.776313782#Z#0.000000006#O#36.074256897 (column 2)
* Returning: KA7HUU74 (column 1)
* Returning: 21 (column 3)
* Returning: 1 (column 4)
* Returning: Kalaine (column 0)
* Returning: #A#sgk_jae_dng_arca1#X#37.158470154#Y#29.817396164#Z#-4.000000000#O#270.460083008 (column 2)
* Returning: KA7HARHW (column 1)
* Returning: 22 (column 3)
* Returning: 1 (column 4)
* Returning: Bronco Mermax (column 0)
* Executing: SELECT * FROM servers WHERE ID=0
* Returning: ALFA 000 Basemod (column 1)
* Returning: 1.1.1.1:5121 (column 2)
* Executing: UPDATE characters SET IsOnline=0
* Executing: SELECT Status FROM characters WHERE id=0
* Executing: SELECT ID FROM item_properties WHERE ItemProperty in (15,11) and IsIllegal=1
* Executing: SELECT IsBanned FROM cdkeys WHERE CDKey='KA7HUU74'
* Returning: 0 (column 0)
* Executing: SELECT IsBanned FROM ipaddress WHERE CDKey='KA7HUU74'
* Returning: 0 (column 0)
* Executing: SELECT ID, IsBanned, CDKey FROM players WHERE Name='indio'
* Returning: 0 (column 1)
* Returning: 1 (column 0)
* Returning: KA7HUU74 (column 2)
* Executing: SELECT ID, IsDeleted, IsPlayable FROM characters WHERE PlayerID=1 and Name='Augy'
* Returning: 0 (column 1)
* Returning: 1 (column 2)
* Returning: 84 (column 0)
* Executing: INSERT INTO logs (ServerID, CharacterID, Event, Description) VALUES (0,84,'Login','Character: Augy')
* Executing: SELECT Value FROM pwdata WHERE Name='Augy' and Tag='KA7HUU74' and `Key`='ACR_MOD_STARTINGGOLD'
* Returning: 1 (column 0)
* Executing: SELECT Value FROM pwdata WHERE Name='Augy' and Tag='KA7HUU74' and `Key`='ACR_MOD_STARTARMORX'
* Returning: 1 (column 0)
* Executing: SELECT Value FROM pwdata WHERE Name='Augy' and Tag='KA7HUU74' and `Key`='ACR_MOD_FIRSTAID_IT'
* Returning: 1 (column 0)
* Executing: SELECT ServerID, XP, GP, STR, CON, DEX, `INT`, WIS, CHA, Damage, Location FROM characters WHERE ID=84
* Returning: #A#01a_startarea#X#40.900291443#Y#22.762990952#Z#-0.000000000#O#270.000000000 (column 10)
* Returning: 0 (column 0)
* Returning: 0 (column 1)
* Returning: 300 (column 2)
* Returning: 16 (column 3)
* Returning: 16 (column 4)
* Returning: 16 (column 5)
* Returning: 10 (column 6)
* Returning: 10 (column 7)
* Returning: 8 (column 8)
* Returning: 0 (column 9)
* Executing: UPDATE characters, players SET characters.IsOnline=1, players.LastLogin=now(), players.Logins=players.Logins+1, players.IsDM=0 WHERE characters.ID=84 and players.ID=characters.PlayerID
* Executing: SELECT Status FROM characters WHERE id=84
* Returning: 0 (column 0)
* Executing: SELECT Status FROM characters WHERE id=84
* Returning: 0 (column 0)
* Executing: SELECT Value FROM pwdata WHERE Name='Augy' and Tag='KA7HUU74' and `Key`='ACR_DTH_LOCATION'
* Executing: SELECT PlotID, PlotState FROM quests WHERE ServerID=0 AND CharacterID=84
* Executing: SELECT Status FROM characters WHERE id=84
* Returning: 0 (column 0)
* Executing: SELECT Status FROM characters WHERE id=84
* Returning: 0 (column 0)
* Executing: SELECT Value FROM pwdata WHERE Name='Augy' and Tag='KA7HUU74' and `Key`='ACR_REST_LOGOUT_TIMER'
* Returning: 664356002 (column 0)
* Executing: UPDATE characters SET ServerID=0, Location='#A#01a_startarea#X#40.900291443#Y#22.762990952#Z#-0.000000000#O#270.000000000', Level=1, Deity='No Deity', HP=15, XP=0, GP=300, Morals=85, Ethics=50, Damage=0, Class1=0, Class2=255, Class3=255, Level1=1, Level2=0, Level3=0, STR=16, CON=16, DEX=16, `INT`=10, WIS=10, CHA=8 WHERE ID=84
* Executing: SELECT Status FROM characters WHERE id=84
* Returning: 0 (column 0)
* Executing: SELECT Status FROM characters WHERE id=84
* Returning: 0 (column 0)
* Executing: SELECT Value FROM pwdata WHERE Name='Augy' and Tag='KA7HUU74' and `Key`='ACR_XP_BANKED_RPHOURS'
* Returning: 0 (column 0)
* Executing: SELECT PlotState FROM quests WHERE ServerID=0 AND CharacterID=84 AND PlotID='sp_pirates_a'
* Executing: SELECT PlotState FROM quests WHERE ServerID=0 AND CharacterID=84 AND PlotID='sp_pirates_a'
* Executing: INSERT INTO logs (ServerID, CharacterID, Event, Description) VALUES (0,84,'Logout','Character: Augy')
* Executing: INSERT INTO pwdata (Name, Tag, `Key`, Value, Expiration) VALUES ('Augy','KA7HUU74','ACR_REST_LOGOUT_TIMER', '664356722', 0) ON DUPLICATE KEY UPDATE Value='664356722', Expiration=0
* Executing: UPDATE characters SET ServerID=0, Level=1, Deity='No Deity', HP=15, XP=0, GP=300, Morals=85, Ethics=50, Damage=0, Class1=0, Class2=255, Class3=255, Level1=1, Level2=0, Level3=0, STR=16, CON=16, DEX=16, `INT`=10, WIS=10, CHA=8 WHERE ID=84
* Executing: SELECT Status FROM characters WHERE id=84
* Returning: 0 (column 0)
* Executing: UPDATE characters SET IsOnline=0 WHERE ID=84
* Executing: INSERT INTO pwdata (Name, Tag, `Key`, Value, Expiration) VALUES ('Augy','KA7HUU74','ACR_XP_BANKED_RPHOURS', '0', 0) ON DUPLICATE KEY UPDATE Value='0', Expiration=0
* Plugin unloaded.
Image
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

This is my mysql.ini, for reference. P/W edited out.

# MySQL server connection parameters
class = SQL
server = vault.alandfaraway.org
user = alfa_beta
password = aaa.aaaa
schema = alfa_beta


# How much information should be written to xp_mysql.txt:
# 0=nothing, 1=only errors, 2=everything
loglevel = 2
Image
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

I was just working on the basics with this one, so it probably doesn't include the updated quest assignment/advancement scripts- I'll make sure those are in the next version which should be out soon. I'll also include them as an erf to facilitate updating your merged mod. Looking at that xp_mysql.txt, I don't see any quest state updates- only queries for quest state, none of which return anything. The rest of the database functions seem to be working, so I'd suspect the quest assignment function isn't doing it's job, assuming it's being called somewhere in there. I did change parameters on that one a while back, which could explain some of it.
User avatar
darrenhfx
Beholder
Posts: 1982
Joined: Fri Jul 30, 2004 5:35 pm
Location: Halifax, Canada GMT -4 (AST)

Post by darrenhfx »

Thanks AL. It's a good idea for me to keep a clean basemod on my hard drive. :)
User avatar
Wynna
Dungeon Master
Posts: 5734
Joined: Sat Jan 03, 2004 10:09 am
Location: Seattle, WA (PST)

Post by Wynna »

Indio, when I fixed the fochlucan quests last week, I had to swap non-functioning acr_quest_start (name perhaps not right, don't have toolset open) for the functioning quest_a_start. Same for the finish quest. Use quest_a_finish, not the acr one. For your conditional, use quest_t_progress.

This fixed those quests and I'm guessing you're using the old functions so it will fix yours.
Enjoy the game
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

Neither of those customized quest_a_* scripts are in the basemod currently. What ought to work better would be updating the "official" quest scripts to get them compatible again, something I'll try to get sorted for the next update of the basemod.
User avatar
Wynna
Dungeon Master
Posts: 5734
Joined: Sat Jan 03, 2004 10:09 am
Location: Seattle, WA (PST)

Post by Wynna »

Cool. Thanks, AL.
Enjoy the game
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

Oh, wow. That's great Wynna. Can you post copies of those scripts here so I can add them manually to give them a shot please?

No need. Of course I have a copy. Doh!
Last edited by indio on Tue Aug 12, 2008 7:16 am, edited 1 time in total.
Image
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

AL, I get this error when I load the basemod...I forgot to post about this last night. I've got the talk file in the place it's looking for it, so not sure why the error:

Image
Image
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

Tried with the quest_a scripts...same result.

What's most frustrating is that all these quests used to work, so something has changed beyind my control and I can't for the life of me figure out what it is.

But if I can log in successfully, have locations not save and quests not work...surely it points to something.
Image
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

Apologies, I wasn't as clear as I could have been. I took those functions you'd used (quest_a_finish, etc) and modified them to work with later developments in the quest system. So, your original versions aren't going to have those changes unless they're pulled from a recent version of TSM.

For now, I'll just paste them, since you seem eager to get this sorted:
quest_a_start wrote:#include "acr_quest_i"

void main(string sQuest, int nState, int bAllPartyMembers=TRUE, int bAllPlayers=FALSE, int bAllowOverrideHigher=FALSE, int nXP=0)
{
// add the quest to the player and his party
ACR_AddPersistentJournalQuestEntry(sQuest, nState, GetPCSpeaker(), bAllPartyMembers, bAllPlayers, bAllowOverrideHigher, nXP);
}
quest_a_finsh wrote:#include "acr_quest_i"


void main(string sQuest, int nGold, int bPartyWide=FALSE)
{
object oPC = GetPCSpeaker();
object oItem = GetLocalObject(oPC, sQuest);

// reward the player
GiveGoldToCreature(oPC, nGold);

// remove the quest item if one exists
if (GetIsObjectValid(oItem)) { DestroyObject(oItem); }

// update the quest to its final (completed) state
ACR_AddPersistentJournalQuestEntry(sQuest, ACR_RetrieveQuestState(sQuest, oPC) + 1, oPC, bPartyWide, FALSE, FALSE);
}
Also, make sure your alfa_acr.hak is fully updated (opening acr_quest_i should show " 2008/05/31 AcadiusLost - added timed despawns to quest creatures" as the last update in the header).

As far as the tlk goes, you need the normal copy in the /documents/nwn2/tlk folder, and also a spare copy without any extension (just called "alfa_acr01" in your /program files/atari/nwn2/ folder (same place the default Dialog.TLK is).

Hope this helps.
Locked