Skip to content

scripts_system::find_script_of_type()

Paweł Waligóra edited this page May 22, 2024 · 2 revisions

Description

Function finds script by its' name and it's type. Returns pointer to a scripts_system::script or it's subclass specified by type parameter. Takes std::string as argument and a type parameter. Returns nullptr if no script matched the requirements.

#include "scripts_system.h"

Usage

#include "scripts_system.h"
game::player* pl = scripts_system::find_script_of_type<game::player>("player");
if (pl != nullptr) {
    // do something with pl
}

See also

for alternative methods of finding game scripts.

Home

Git Workflow

Issues

Coding Rules

Skrypty-Tutorial

Useful resources

Game Structure

Code Structure

Clone this wiki locally