SQL check Please

stapano00

Chieftain
Joined
Jul 11, 2014
Messages
97
Location
NY - America
Code:
INSERT OR REPLACE INTO Belief_BuildingClassFaithPurchase (BeliefType,	BuildingClassType)
SELECT ('BELIEF_GODIDEA'), Type
FROM BuildingClasses WHERE ID >= -1;


INSERT OR REPLACE INTO Buildings (Type, Cost, FaithCost, UnlockedByBelief)
SELECT Type, Cost, Cost*2 , 1
FROM Buildings WHERE ID >= -1;


I want to Make Every buildings are purchasable by faith.

and It gets this error

[194638.000] ERROR: Building does not contain valid BuildingClass type!!


Is there any other way to do?
 
Your second SQL INSERT is (incompletely) duplicating every building, it should be an UPDATE

Code:
UPDATE Buildings SET UnlockedByBelief=1, FaithCost=Cost*2 WHERE UnlockedByBelief=0;

which will give every building a faith cost, (but whether that will actually achieve the effect you want I don't know)
 
You're also going to get every world wonder and every national wonder being faith purchasable. Since a national wonder and a world wonder are just buildings within the XML/SQL. Not sure how the game will react.
 
Wonders can't be hurried, so adding " AND HurryCostModifier<>-1" to the end will fix those
 
Top Bottom