Mopafid
Chieftain
- Joined
- Nov 20, 2017
- Messages
- 8
Heya,
I'm trying to add a secondary class to several units at once, and have done it in the same way I've always inserted multiple lines into an SQL query.
However with this, I'm encountering this error - and I don't get why? Do I need to do it in a specific way, or how?
I'm trying to implement the following:
EDIT: I have 3 different sets of TypeTags code, and I have no clue which one of the three are causing the error.
I presumed since the base files would attach several different Types to the same Tag, that I could do the same through an SQL update - which seems that I can not? Help? :/
EDITEDIT:
And, solved!
Apparently the following was the culprit:
I was loading the code in my first post BEFORE this update code, which for some reason caused the error.
I simply moved the UPDATE code further up the code than my INSERT INTO, and the error vanished - and with a quick test in-game, everything seems to work as it should.
I'm trying to add a secondary class to several units at once, and have done it in the same way I've always inserted multiple lines into an SQL query.
However with this, I'm encountering this error - and I don't get why? Do I need to do it in a specific way, or how?
Code:
[Gameplay] ERROR: UNIQUE constraint failed: TypeTags.Type, TypeTags.Tag
I'm trying to implement the following:
Code:
INSERT INTO TypeTags (Type, Tag)
VALUES
('UNIT_SCYTHIAN_HORSE_ARCHER', 'CLASS_SM_HORSE_CAVALRY'),
('UNIT_HORSEMAN', 'CLASS_SM_HORSE_CAVALRY'),
('UNIT_CAVALRY', 'CLASS_SM_HORSE_CAVALRY'),
('UNIT_HEAVY_CHARIOT', 'CLASS_SM_HORSE_CAVALRY'),
('UNIT_KNIGHT', 'CLASS_SM_HORSE_CAVALRY');
EDIT: I have 3 different sets of TypeTags code, and I have no clue which one of the three are causing the error.
I presumed since the base files would attach several different Types to the same Tag, that I could do the same through an SQL update - which seems that I can not? Help? :/
EDITEDIT:
And, solved!
Apparently the following was the culprit:
Code:
UPDATE TypeTags --gives the saka its own class
SET
Tag = 'CLASS_SAKA_HORSE'
WHERE Type = 'UNIT_SCYTHIAN_HORSE_ARCHER';
I was loading the code in my first post BEFORE this update code, which for some reason caused the error.
I simply moved the UPDATE code further up the code than my INSERT INTO, and the error vanished - and with a quick test in-game, everything seems to work as it should.
Last edited: