[ACS] Quest Journal display

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!
Post Reply
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

[ACS] Quest Journal display

Post by ramon.dexter »

Here is ACS source for quest journal display, using HudMessages and arrays. cocka and Popsoap10 helped me with this code a lot. So here it is for free use. Explanation is in the code.

Code: Select all

//JOURNAL DISPLAY
//==----------------------------------------------------------------==
script "showJournal" (void) //this is used to open and close the journal screen; I used KEYCONF to assign a key to this script
{
	if(showJournal==0)
	{
		ACS_NamedExecute("displayJournal2",0);
	}
	
	else if(showJournal==1)
	{				
		ACS_NamedExecute("eraseDisplayedJournal",0);		
	}
}

bool m01QuestActive[2] = {false, false}; // Initializing to false - to indicate if quest if active or not
str m01Quest[3] = {"", "", ""};                 // Initializing to an empty string - here goes script infotext
str m01QuestActivity[3] = {"", "", ""};         // Initializing to an empty string - quest activity comment
	 
script "displayJournal2" (void)
{
	SetFont("QSTLBK"); //not really necessary, just journal screen background
	HudMessage(s:"A"; HUDMSG_PLAIN, 7010, 0, 0.85, 0.5, 0); //journal background
   SetFont("SmallFont");
   HudMessage(s:"\c[darkred]<= JOURNAL =>"; //journal screen header, hard-coded
                  HUDMSG_PLAIN, 7000, CR_GRAY, 0.75, 0.3, 0);
           
   //and here the magic begins
   for(int counter=0; counter < 3; counter++) // Loop through every quest, used for aadding new lines; change counter < 3  if you have more than 3 quests
   {
      if(m01QuestActive[counter] == true) // If this quest is active...
      {
			//print(i:counter);
          HudMessage(s: m01Quest[counter]; //quest text, according to counter value; when m01quest[counter] is true, counter counts +1 and hudmessages are drawn.
							HUDMSG_PLAIN, 7001 + counter, CR_GRAY, 0.65, 0.4 + (counter * 0.1), 0);
          HudMessage(s: m01QuestActivity[counter];  //quest status
							HUDMSG_PLAIN, 7004 + counter, CR_Yellow, 0.9, 0.4 + (counter * 0.1), 0);
        
      }
   }
  
   
   showJournal = 1;
}



script "eraseDisplayedJournal" (void) //up to 9 quests could be used in this script...if you want to use more quests, you have to add hudmsgs...ot modify it to used the 'counter' :)
{
	HudMessage(s:""; //nadpis
				HUDMSG_PLAIN, 7000, CR_GRAY, 0.75, 0.3, 0);
	HudMessage(s:""; //quest 1
				HUDMSG_PLAIN, 7001, CR_GRAY, 0.7, 0.4, 0);
	HudMessage(s:""; //quest 2
				HUDMSG_PLAIN, 7002, CR_GRAY, 0.7, 0.45, 0);
	HudMessage(s:""; //quest 3
				HUDMSG_PLAIN, 7003, CR_GRAY, 0.7, 0.5, 0);
	HudMessage(s:""; //quest 1 note
				HUDMSG_PLAIN, 7004, CR_GRAY, 0.9, 0.4, 0);
	HudMessage(s:""; //quest 2 note
				HUDMSG_PLAIN, 7005, CR_GRAY, 0.9, 0.45, 0);
	HudMessage(s:""; //quest 3 note
				HUDMSG_PLAIN, 7006, CR_GRAY, 0.9, 0.5, 0);
	HudMessage(s:""; 
				HUDMSG_PLAIN, 7007, 0, 0.6, 0.3, 0);
	HudMessage(s:""; 
				HUDMSG_PLAIN, 7008, 0, 0.6, 0.6, 0);
	HudMessage(s:""; 
				HUDMSG_PLAIN, 7009, 0, 0.6, 0.6, 0);
	HudMessage(s:""; 
				HUDMSG_PLAIN, 7010, 0, 0.6, 0.6, 0);
	showJournal = 0;
}

//==----------------------------------------------------------------==
//
//=====================================================================================



//Map01 quests
//==------------------------------------------------------------------------------------------==
//this is made, so you will be able to individually assign quests with individual text and comment
//mXXquestXX is used to start the quest
//mXXquestXXcompleted is used to finish the quest
script "m01Quest01" (void)
{
   m01QuestActive[0] = true;         // m02quest01active = true;
   m01Quest[0] = "You have to find a way through\nthe training dungeon #1.\nYou'll be rewarded, if you succeed."; // m02Quest01 = "This is quest 01";
   m01QuestActivity[0] = "active";   // m02quest01activity = "active";
}
script "m01quest01completed" (void)
{
	m01QuestActivity[0] = "\c[green]completed";
	//XP = XP + 400;
	Print(s:"Training dungeon #1 completed!");
}

script "m01Quest02" (void)
{
   m01QuestActive[1] = true;         // m02quest02active = true;
   m01Quest[1] = "You have to find a way through\nthe training dungeon #2.\nYou'll be rewarded, if you succeed."; // m02Quest02 = "This is quest 02";
   m01QuestActivity[1] = "active";   // m02quest02activity = "active";
}
script "m01quest02completed" (void)
{
	m01QuestActivity[1] = "\c[green]completed";
	//XP = XP + 400;
	Print(s:"Training dungeon #2 completed!");
}
//==------------------------------------------------------------------------------------------==
//=====================================================================================
User avatar
bitsy
Posts: 14
Joined: Fri Jan 11, 2019 2:13 pm

Re: [ACS] Quest Journal display

Post by bitsy »

thanks alot. ill give denitely give u credits <3 :D
Post Reply

Return to “Resources”