Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CalloutToolbox [For Developers] 1.1.0.0

2 Screenshots

CalloutToolbox

CalloutToolbox is a lightweight C# library designed to enhance code readability, improve quality of life, and save development time when scripting callouts.

 

This library includes:

- a mission system

- a dialog system

- a simple timer

- a simple randomizer utility class

 

Introducing: The debugger

The debugger is a simple tool to debug your callouts direclty ingame.

Requires RageNativeUI (not included in download)

- Debug missions, blips & entites directly ingame through a menu

- Draw any debug text directly on screen

 

 

Cheers!

 

 

Documentation:

The debugger: (Requires RageNativeUI)

Spoiler

The debugger has its own GameFiber, meaning you can access the menu without a callout of your pack keeping it alive.

Thus, an instance of the debugger should only be created once when your pack is loaded.

This code would create an instance for the callout pack "TestCalloutPack" (the only purpose of providing a name is for it to be displayed in the debugger menu) and sets the F7 key as the key to toggle the debugger menu: 

Debugger debugger = new Debugger(Keys.F7, "TestCalloutPack");

 

Whenever you add a mission, entity or blip it gets "cached" (in other words added to a list). This allows you to modify whatever you've added through the menu ingame.

So it is important to clear the cache either at the end or directly at the start of a callout otherwise it would pile up over time. Clearing it at the start instead of the end has the benefit of you still being able to modify cached stuff after the callout ended.

debugger.ClearCache();

 

Draw text on screen:

// Examples:
debugger.DrawDebugText(0, $"Suspect is alive: { suspect.IsAlive }");
debugger.DrawDebugText(1, $"Current mission stage: { mission.GetCurrentStage() } ");

The integer provided determines the line. The first debug text will be drawn in line 0, the second one in line 1.

 

You can currently cache the the following:

- Missions

- Blips

- Entities

debugger.Entities.Add(ped3);
debugger.Blips.Add(blip1);
debugger.Mission = mission;

 

 

Mission.cs

Spoiler

The mission system maps Actions to indexes. The Action gets invoked based on the current index ('stage'). To invoke the current Action, use Update(). To contiously invoke the current Action for callout scripting, the inherited Process() method from Callout.cs is suited best.

 

Creating a mission:

Mission mission = new Mission();

 

You can define an action in the constructor that gets invoked when the mission was started with Start(). This is suited best for spawing mission relevant entities.

Mission mission = new Mission(() => {
	// Add logic here
}

 

Adding a stage to the mission:

// The 0 represents the index for the stage
mission.Add(0, () => {
	// Add the stage logic here
  	
  	// If you want to progress to the next stage, you can return true at any point.
  	// The mission will then automatically proceed to the next stage.
  
  	// As long as false is returned, the mission will stay in the current stage.
  	return false;
}

 

Alternatively to proceed to another stage, you can use

mission.JumpTo(index);

to jump to a specific stage at any point.

 

Once you're ready adding all the stages, use Start(). Once started, the Update() method will start executing the code for the current stage when called.

Jump to any index that does not belong to any stage to end the mission.

 

Dialog.cs

Spoiler

The dialog system holds an array of strings (the dialog) and an index which determines the current string of dialog.

 

Creating dialog:

Dialog dialog = new Dialog(new string[] {
  	"Person 1: Lorem ipsum",
  	"Person 2: What?"
}

 

Use Progress() to progress the dialog (increase the index by 1).

The index starts at -1. Use GetCurrentMessage() to get the current string based on the index.

 

Example of displaying dialog using Rage:

if (userPressedInteractKey)
{
 	dialog.Progress();
  	Game.DisplaySubtitle(dialog.GetCurrentMessage());
}

 

You can map Actions to any index of the dialog, which gets invoked once when the dialog reaches this specific index. This can be useful to trigger code once the NPC says a specific line.

mission.AddActionToIndex(0, () => {
  // This would map this codeblock to the first line of the dialog (index 0)
}

 

 

SimpleTimer.cs

Spoiler

SimpleTimer is a class holding an Action and an integer. The class uses the Update() method to reduce the int by 1 when called. Once the int reaches 0, the Action gets invoked.

Creating a timer:

SimpleTimer timer = new SimpleTimer(() => {
  	// Add logic here
  	// Example usecase: A suspect starts fleeing after a certain amount of time.
}, 100);

 

 

Randomizer.cs

Spoiler

This is a class containing a hand full of methods to save some time for adding randomness to callouts.

 

Example 1:

Choosing a random ped as the suspect.

Ped suspect = (Ped) Randomizer.Choose(ped1, ped2, ped3, ped4);

 

Example 2:

Choosing a vehicle speed from a specific selection.

float speed = Randomizer.ChooseFloat(10f, 15f, 20f, 30f);

 

Edited by LouiDev

What's New in Version 1.1.0.0

Released

Introducing: The debugger

User Feedback

Recommended Comments

There are no comments to display.

Create an account or sign in to comment

Latest Mods

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.