[MOD][WIP] Custom Player Titles v0.3.5

Place for sharing your game modifications for Life is Feudal: Your Own

Vendaar
 
Posts: 2
Joined: 08 Dec 2014, 02:18

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Vendaar » 08 Dec 2014, 02:19

I got this error :(

/* SQL Fehler (1064) in Anweisung #13: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE DEFINER=`root`@`localhost` TRIGGER `t_addCharacterTitle_CharacterChange` ' at line 29 */
/* Affected rows: 0 Gefundene Zeilen: 0 Warnungen: 0 Dauer von 0 of 71 queries: 0,000 sec. */

User avatar
GruFF
Zealous Believer
 
Posts: 111
Joined: 20 Sep 2014, 02:06

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by GruFF » 10 Dec 2014, 21:09

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (1, 'Game M' at line 1
[Err] INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (1, 'Game Master Title', 762) etc....


Lequeb
 
Posts: 5
Joined: 04 Dec 2014, 10:17

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Lequeb » 16 Dec 2014, 17:52

Yup same error here.

Definitly not working at all.

Thanks for effort.


Zengetzu
 
Posts: 10
Joined: 13 Sep 2014, 14:51

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Zengetzu » 06 Jan 2015, 15:22

All right so im new to the modding idea and need help/questions on this.
I have heidisql and have already changed claim times and alt char alignments but I cant see where the titles are nothing shows up in the data.
Also where would i enter that code to change the titles. ideally I would just like to give titles to players steam IDs.
I seen someone comment but i dont understand it.
I have also looked for guides for this but not much there.

thank you

ok so i have been looking at the code and think i can change it so that the players will have titles based solely on their alignment.
that way i can go in and change their alignment to whatever.
I know this is totally round about but im still new to this also where do i add the code just to "query" and send batch in one go?
just not sure where to do that at or if it matters.
I did do that before when i was setting up my dedicated server


Balax
 
Posts: 40
Joined: 30 Sep 2014, 11:03
Location: Norway

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Balax » 06 Jan 2015, 21:20

I have given this some thought, and this might be a solution.
I have not tried this myself, so as always make the necessary backups.

Open the files on your server with "FileZilla" or similar program.
Under "data" you will find CM_MESSAGES.XML.

Open that file and check out line Line 490 - 670 which
describes all the different titles. Then minimize it for now.

In heidsSql, find "titles" at the bottom.
Under data, add line. There are three rows, "ID", "NAME" and "TitleMessageID"

Now, all the titles you want to put in will have an unique number from 1 going up.

So "ID" is 1, 2, 3, 4, 5 and so on.

"NAME" is your description of the title, for example king.

"TitleMessageID" from CM_MESSAGES.XML is the ID-line where you find the title you want,
in this example 650 which is the number for King.

So it would look like this:

ID Name TitleMessageID
1 King 650
2 Queen 651
3 Officer 628

Now find the table called Character_titles.

Add line, ID is same as above, 1,2,3,4 and so on.
Fill in #ID of the character in question, which you find under SQL-table "Character".
The third thing is the title you made above.

So for character 3 it should look like this if he is to be the king:

ID CharacterID TitleID
1 3 1

and so on and so on.

I want to make clear again that I have NOT tested this out.
This is merely a suggestion of something you can try.
All you do is your own responsibility.

BTW, I do not know what this will do to the title you choose yourself under the "Person" window in-game. But someone daring might find out. It might appear above it, or as an option in the pull-down menu. Time will tell.

Good luck!


Zengetzu
 
Posts: 10
Joined: 13 Sep 2014, 14:51

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Zengetzu » 07 Jan 2015, 04:11

ok so the way i see it, i can just change the title names in the cm_messages and then it should show up different in game. Or so i think but when i open my cm_messages.xml file from both my dedicated server and my blackbox server it just shows alittle bit not titles and the blackbox server says

"This page contains the following errors:

error on line 69 at column 17: xmlParseCharRef: invalid xmlChar value 7
Below is a rendering of the page up to the first error."

the last thing that it shows is "You have succesfully tamed the %1"

So my question is if i can get the cm_message to work can i change for example the title of grandmaster cook = chief or pope = monk and it will reflect in game when a charater should show grandmaster x it will instead show what i want.


Balax
 
Posts: 40
Joined: 30 Sep 2014, 11:03
Location: Norway

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Balax » 07 Jan 2015, 08:52

Zengetzu wrote:ok so the way i see it, i can just change the title names in the cm_messages and then it should show up different in game.


In theory, yes. If both server and client have the same changes in the same files.

Zengetzu wrote: Or so i think but when i open my cm_messages.xml file from both my dedicated server and my blackbox server it just shows alittle bit not titles and the blackbox server says

"This page contains the following errors:

error on line 69 at column 17: xmlParseCharRef: invalid xmlChar value 7
Below is a rendering of the page up to the first error."

the last thing that it shows is "You have succesfully tamed the %1"

I dont know why this happens. Have you any other mods or changes in your game that you have downloaded or similar, or are your files vanilla?

Zengetzu wrote: So my question is if i can get the cm_message to work can i change for example the title of grandmaster cook = chief or pope = monk and it will reflect in game when a charater should show grandmaster x it will instead show what i want.


This might be the case, yes. However if I can give any practical advice at this point it would be to change only one thing at a time and then check for success/failure. One thing at a time until you are sure of how it works.

Good luck!


Zengetzu
 
Posts: 10
Joined: 13 Sep 2014, 14:51

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Zengetzu » 07 Jan 2015, 15:22

Ok so first question how does one change the client side info for someone other than myself? thats what i understand from it

I also figured out how to edit my cm_messages i changed pope to monk and a few others as a test but nothing has changed in game.

i only edited the cm_message.xml file and nothing in heidisql but i have a feeling im going to have to do that. I am thinking that either the client side doesnt allow it or something in the patch.sql override it like in the claim times.

I have figured out most of the code for the heidisql. Guessing it gets rid of all other titles except those u add. I dont mind this but would like to avoid it if i can.

If i do use that code where do i add it? under "titles" or "charater titles"? and i simple plug it in through the "query" right

Thanks


Zengetzu
 
Posts: 10
Joined: 13 Sep 2014, 14:51

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Zengetzu » 07 Jan 2015, 17:08

ok so i tried change the titles in cm_message in both server side and client side files. The result is

Image

Only problem is that I only can see the title and no one else can. Guessing that means they need to change the files as well in order to see it. This just means i need to get almost 70 players to change their client side game files which i do not see happening.

Ah i just put two and two together and understand the code he used (650) is king thats already in the game thats why it will show on everyones game. Looks like the only way/easiest way to change titles is through sqlcode. Still dont know where to add the code at in heidisql


Zengetzu
 
Posts: 10
Joined: 13 Sep 2014, 14:51

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Zengetzu » 07 Jan 2015, 20:53

Ok so I changed the code post on this page to reflect what I am wanting. Others are free to try it out. I have not and I was wondering if anyone wants to look to see if its functional.
It is based on the GM changing players alignment to give them titles so if a server elects a king the GM can make the alignment of the king 900 which will give him the title king. Same code used for the pope and cardinal that was posted.
Code: Select all
INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (1, 'Game Master Title', 762);

INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (2, 'King Title', 650);
INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (3, 'Duke Title', 648);
INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (4, 'Count Title', 646);
INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (5, 'Baron Title', 642);
INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (6, 'Knight Title', 626);

INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (7, 'Peasant Title', 636);
INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (8, 'Sergant Title', 624);

INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (9, 'Crusader Title', 655);
INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (10, 'Royal Knight Title', 653);
INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (11, 'Pope Title', 597);
INSERT IGNORE INTO titles (`ID`, `Name`, `TitleMessageID`) VALUES (12, 'Cardinal Title', 596);

CREATE DEFINER=`root`@`localhost` TRIGGER `t_addCharacterTitle_SkillChange` AFTER UPDATE ON `skills` FOR EACH ROW BEGIN
   IF NEW.SkillTypeID = 65 THEN
      IF NEW.LockStatus > 0 THEN
         SET @kingCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 2);
         SET @dukeCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 3);
         SET @countCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 4);
         SET @baronCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 5);
         SET @KnightCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 6);
         IF NEW.SkillAmount = 1000000000 THEN
            SET @characterAlignment = (SELECT ch.Alignment FROM `character` ch WHERE ch.ID = NEW.CharacterID);
            IF @characterAlignment = 900000000 AND @KingCount = 0 THEN
               CALL p_addCharacterTitle(NEW.CharacterID, 2);
            ELSEIF @characterAlignment > 800000000 AND @DukeCount < 10 THEN
               CALL p_addCharacterTitle(NEW.CharacterID, 3);
            ELSEIF @characterAlignment > 700000000 AND @CountCount < 10 THEN
               CALL p_addCharacterTitle(NEW.CharacterID, 4);
            ELSEIF @characterAlignment > 600000000 AND @BaronCount < 10 THEN
               CALL p_addCharacterTitle(NEW.CharacterID, 5);
            ELSEIF @characterAlignment > 500000000 AND @KnightCount < 10 THEN
               CALL p_addCharacterTitle(NEW.CharacterID, 6);
            END IF;
         END IF;
      END IF;
   IF NEW.SkillAmount < 1000000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.CharacterID AND (TitleID = 2 OR TitleID = 3);
      END IF;
   END IF;IF NEW.SkillTypeID = 65 THEN
      IF NEW.LockStatus > 0 THEN
         SET @kingCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 2);
         SET @dukeCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 3);
         SET @countCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 4);
         SET @baronCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 5);
         SET @KnightCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 6);
         IF NEW.SkillAmount = 1000000000 AND @kingCount = 0 THEN
            CALL p_addCharacterTitle(NEW.CharacterID, 2);
         ELSEIF NEW.SkillAmount > 1000000000 AND @dukeCount < 5 THEN
            CALL p_addCharacterTitle(NEW.CharacterID, 3);
         ELSEIF NEW.SkillAmount > 1000000000 AND @countCount < 15 THEN
            CALL p_addCharacterTitle(NEW.CharacterID, 4);
         ELSEIF NEW.SkillAmount > 1000000000 AND @baronCount < 50 THEN
            CALL p_addCharacterTitle(NEW.CharacterID, 5);
         ELSEIF NEW.SkillAmount > 1000000000 THEN
            CALL p_addCharacterTitle(NEW.CharacterID, 6);
         END IF;
   END IF;
   IF NEW.SkillTypeID = 54 THEN
      IF NEW.LockStatus > 0 THEN
         SET @CrusaderCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 9);
         SET @Royal KnightCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 10);
         SET @popeCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 11);
         SET @cardinalCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 12);
         IF NEW.SkillAmount = 1000000000 THEN
            SET @characterAlignment = (SELECT ch.Alignment FROM `character` ch WHERE ch.ID = NEW.CharacterID);
            IF @characterAlignment = 900000000 AND @popeCount = 0 THEN
               CALL p_addCharacterTitle(NEW.CharacterID, 11);
            ELSEIF @characterAlignment > 800000000 AND @cardinalCount < 10 THEN
               CALL p_addCharacterTitle(NEW.CharacterID, 12);
            ELSEIF @characterAlignment > 500000000 AND @Royal KnightCount < 10 THEN
               CALL p_addCharacterTitle(NEW.CharacterID, 10);
            ELSEIF @characterAlignment > 100000000 AND @CrusdaerCount < 10 THEN
               CALL p_addCharacterTitle(NEW.CharacterID, 9);
            END IF;
         END IF;
      END IF;
      IF NEW.SkillAmount < 1000000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.CharacterID AND (TitleID = 11 OR TitleID = 12);
      END IF;
   END IF;
   IF NEW.SkillTypeID = 31 THEN
      IF NEW.LockStatus > 0 THEN
         IF NEW.SkillAmount = 1000000000 THEN
            CALL p_addCharacterTitle(NEW.CharacterID, 8);
         ELSEIF NEW.SkillAmount > 900000000 THEN
            CALL p_addCharacterTitle(NEW.CharacterID, 7);
         END IF;
      END IF;
      IF NEW.SkillAmount < 1000000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.CharacterID AND TitleID = 8;
      END IF;
   END IF;
END

CREATE DEFINER=`root`@`localhost` TRIGGER `t_addCharacterTitle_CharacterChange` BEFORE UPDATE ON `character` FOR EACH ROW BEGIN
   SET @pietyAmount = (SELECT sk.SkillAmount FROM skills sk WHERE sk.CharacterID = NEW.ID AND sk.SkillTypeID = 54);
   IF @pietyAmount = 1000000000 THEN
      SET @CrusaderCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 9);
      SET @Royal KnightCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 10);
      SET @popeCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 11);
      SET @cardinalCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 12);
      IF NEW.Alignment > 900000000 AND @popeCount = 0 THEN
         CALL p_addCharacterTitle(NEW.ID, 11);
      ELSEIF @characterAlignment > 800000000 AND @cardinalCount < 10 THEN
         CALL p_addCharacterTitle(NEW.ID, 12);
      END IF;
      IF NEW.Alignment < 500000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.ID AND TitleID = 10;
      END IF;
      IF NEW.Alignment < 100000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.ID AND TitleID = 9;
      END IF;
   END IF;
END

CREATE DEFINER=`root`@`localhost` TRIGGER `t_addCharacterTitle_CharacterChange` BEFORE UPDATE ON `character` FOR EACH ROW BEGIN
   SET @AuthorityAmount = (SELECT sk.SkillAmount FROM skills sk WHERE sk.CharacterID = NEW.ID AND sk.SkillTypeID = 65);
   IF @AuthorityAmount = 1000000000 THEN
      SET @KingCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 2);
      SET @DukeCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 3);
      SET @CountCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 4);
      SET @BaronCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 5);
      SET @KnightCount = (SELECT COUNT(*) FROM character_titles WHERE TitleID = 6);
      IF NEW.Alignment > 900000000 AND @KingCount = 0 THEN
         CALL p_addCharacterTitle(NEW.ID, 2);
      ELSEIF @characterAlignment > 800000000 AND @DukeCount < 10 THEN
         CALL p_addCharacterTitle(NEW.ID, 3);
      ELSEIF @characterAlignment > 700000000 AND @CountCount < 10 THEN
         CALL p_addCharacterTitle(NEW.ID, 4);
      ELSEIF @characterAlignment > 600000000 AND @BaronCount < 10 THEN
         CALL p_addCharacterTitle(NEW.ID, 5);
      ELSEIF @characterAlignment > 500000000 AND @KnightCount < 10 THEN
         CALL p_addCharacterTitle(NEW.ID, 6);
      END IF;
      IF NEW.Alignment < 900000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.ID AND TitleID = 2;
      END IF;
      IF NEW.Alignment < 800000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.ID AND TitleID = 3;
      END IF;
      IF NEW.Alignment < 700000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.ID AND TitleID = 4;
      END IF;
      IF NEW.Alignment < 600000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.ID AND TitleID = 5;
      END IF;
      IF NEW.Alignment < 500000000 THEN
         DELETE FROM character_titles WHERE CharacterID = NEW.ID AND TitleID = 6;
      END IF;
   END IF;
END

CREATE DEFINER=`root`@`localhost` PROCEDURE `p_addCharacterTitle`(IN `in_characterID` INT, IN `in_titleID` INT)
   LANGUAGE SQL
   NOT DETERMINISTIC
   MODIFIES SQL DATA
   SQL SECURITY DEFINER
   COMMENT ''
BEGIN
   IF in_characterID > 0 AND in_titleID > 0 THEN
      SET @currentCount = (SELECT COUNT(*) FROM character_titles ct WHERE ct.CharacterID = in_characterID AND ct.TitleID = in_titleID);
      IF @currentCount = 0 THEN
         INSERT IGNORE INTO character_titles (`CharacterID`, `TitleID`) VALUES (in_characterID, in_titleID);
      END IF;
   END IF;
END



Authority 100 (65)
King alignment 900
Duke alignment 800
Count alignment 700
Baron alignment 600
Knight alignment 500

Piety 100 (54)
Pope alignment 900
Cardinal alignment 800
Royal Knight alignment 500
Crusader alignment 100

Militia (31)
Sergeant militia 90
Peasant militia 0-80


NOTE this code is based on the code given and I left the Count measurements just because I didnt want to delete them.
I also do not know if this will work but I will try it shortly


Ok so I tried the code and got the same error as the other guy and was able to fix/figure it out but then it just gave me another error on another line. This one makes no since. The (if new.lock status) is being rejected and Idk y bc I didn't mess with it. Guess I might just have to try the original code see if it even works.


Ziong18
 
Posts: 107
Joined: 09 Oct 2014, 03:48

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Ziong18 » 16 Jan 2015, 02:46

Any updates on this mod? Anybody got it to work yet?

User avatar
Ghost_swe79
True Believer
 
Posts: 41
Joined: 16 Apr 2015, 12:17
Location: Sweden

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Ghost_swe79 » 14 Oct 2015, 11:33

Anymore new news about this?


Riosja
Zealous Believer
 
Posts: 1
Joined: 10 Jun 2016, 21:30

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Riosja » 10 Jun 2016, 21:32

:Yahoo!: how do i install this mod? Are there any updates?


Gms0012
 
Posts: 166
Joined: 23 Feb 2015, 08:49

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Gms0012 » 11 Jun 2016, 10:17

"install" ???

it is a sql script...!

if you dont know what sql is, you should keep your fingers away from it.
Image


Jmansmann
 
Posts: 1
Joined: 05 Sep 2017, 21:11

Re: [MOD][WIP] Custom Player Titles v0.3.5

Post by Jmansmann » 05 Sep 2017, 21:16

Just a question, is there a way to make the titles set to a specific player with out the requirements we run a RP server and this would be great.

Return to Game mods