Majesty Gold HD

Majesty Gold HD

Customize Majesty!
Create and upload new Quests and Mods for Majesty HD!
Create Sign, Post Message, SetAttribute doesn't work
Hey, I found that since the beta2 update perhaps broke the setattribute feature of CreateSigns. I can't figure out an alternative method. Is this feature really broken, or is it just me?

SetAttribute returns a bad conversion to &int
Function Create_Sign2 (agent ThisAgent, string type, integer Message, coordinate Loc) is agent Declare Begin return $SpawnUnit (ThisAgent, Type, Loc, $getunitplayernumber(thisagent), $Concatenate( #ATTRIB_Message_Text, Message)); End

sign = $create_sign2 (palace, "Sign_Fancy_Iron", #sign_barren, coord); if (player == #PLAYER_2) $setattribute (sign, #ATTRIB_Message_Text, "IDTXT_PLAYER2_SIGN"); else if (player == #PLAYER_3) $setattribute (sign, #ATTRIB_Message_Text, "IDTXT_PLAYER3_SIGN");

<Majesty> <Language id="en_US"> <Text id="IDTXT_PLAYER3_SIGN">The Way of the Law</Text>\ <Text id="IDTXT_PLAYER2_SIGN">The Path of Chaos</Text> </Language> </Majesty>
< >
Showing 1-1 of 1 comments
Dracoceros 11 2 Mar, 2023 @ 2:08am 
The answer to this question:

Looks like you'll need to convert a string to an integer

Here's how to cheaply do it with Intent Strings

SpecifyIntent (on let's say the palace), with the intent string

Then, get the attribute from the palace of the ATTRIB_AIIntentionString


I wonder if this method can be used for anything else requiring string to int conversions?

<Majesty> <Language id="en_US"> <Text id="MY_SIGN_TEXT">Yay It Worked!</Text> </Language> </Majesty>


Function Sign_Spawner (agent thisagent) declare agent sign; begin $SpecifyIntent(palace, "MY_SIGN_TEXT"); $create_sign (thisagent, "Sign_Fancy_Iron", $GetAttribute (palace, #ATTRIB_AIIntentionString), thisagent); end
Last edited by Dracoceros; 5 Jul, 2023 @ 5:23pm
< >
Showing 1-1 of 1 comments
Per page: 1530 50