Majesty Gold HD

Majesty Gold HD

Customize Majesty!
Create and upload new Quests and Mods for Majesty HD!
_Harted_ 2 Sep, 2018 @ 12:56pm
Functions for the special events
Is it possible to run scripts for the freestyle events in my quest? I found the necessary functions in the file "Special_Events.gpl", but I can not make them run at the start of the quest.
Perhaps someone can tell me which strings I need to add to the "Quest name" function in order to run a script, for example, Dead_heroes from "Special_Events.gpl" when the quest begins?
< >
Showing 1-3 of 3 comments
_Harted_ 3 Sep, 2018 @ 12:20pm 
I think the problem is that the script does not run for the script. For verification, I created the following simple script in Harted.gpl file:

Function Harted()

declare
list Palaces;
agent AIRootAgent, palace;

begin

AIRootAgent = $RetrieveAgent ( "GplAIRoot" );
palaces = $Listpalaces ();
palace = $listmember(palaces,1);

$setup_random_treasure ( 20, 3000 );

end

and this Harted.mqxml file:
<Majesty>
<Quest id="{45DC54AC-AE30-4A06-81D2-E196307A75E0}">
<DataConfiguration>
<Dataset base="MajestyExpansion">
<Load>
<Template>Harted.q</Template>
<GPL>
<Target>GPL\bytecode.bcd</Target>
<Source>GPL\Harted.gpl</Source>
</GPL>
<GPLSource>GPL</GPLSource>
</Load>
</Dataset>
</DataConfiguration>
<DisplayName lang="en_US">Harted</DisplayName>
<Description lang="en_US">
<Short>Quest</Short>
<Long>Quest</Long>
</Description>
<Difficulty>Easy</Difficulty>
<Name>Harted</Name>
</Quest>
</Majesty>

But at the start of the quest( after compiling .bcd file, of course), treasures are not created.
What am I doing wrong?
Matkatamiba 3 4 Sep, 2018 @ 9:29am 
I haven't really worked with quests (only mods), but are you sure your function is being called? Also, check out the debugger.
amantalado 1 5 Sep, 2018 @ 1:03am 
Originally posted by _Harted_:
Function Harted()

declare
list Palaces;
agent AIRootAgent, palace;

begin

AIRootAgent = $RetrieveAgent ( "GplAIRoot" );
palaces = $Listpalaces ();
palace = $listmember(palaces,1);

$setup_random_treasure ( 20, 3000 );

end

But at the start of the quest( after compiling .bcd file, of course), treasures are not created.
What am I doing wrong?

The function needs to be called somewhere in the script in order for it to execute. The two functions that execute at the start of the game are InitializeGPL and GPLKickoff. You can probably try to splice your custom event into either one of those to make it work. Their code is:
/////////////////////////////////////////////////////////////////////////////// // This function will be called once, before any objects have // been loaded into the map. It should set up any agents // and functions that need to be in place before the game // pieces are loaded onto the map; function InitializeGpl() declare agent AIRootAgent; begin AIRootAgent = $RetrieveAgent("GplAIRoot"); if ( AIRootAgent == $NullAgent() ) begin // Set the script-calling function executing every 1/2 second; // Create the container agent for the agents to be loaded onto the map; $CreateAgent( "GplAIRoot", "GplAIRoot" ); // Retrieve the agent we just created AIRootAgent = $RetrieveAgent("GplAIRoot"); // The following function will be run once, after map objects are loaded: $RunThread( AIRootAgent's "KickoffFunction", 1 ); end end /////////////////////////////////////////////////////////////////////////////// // This function will be called ONCE, after all objects have been loaded onto // the game map, just before all the scripts begin executing; function GplKickoff() declare agent AIRootAgent; agent agentIdx; begin end
Last edited by amantalado; 5 Sep, 2018 @ 1:05am
< >
Showing 1-3 of 3 comments
Per page: 1530 50