Advertisement

No matching signatures to 'string::split(const string)'

Started by August 13, 2013 02:22 PM
4 comments, last by Sir Ementaler 11 years, 3 months ago

The topic title is the error I got when I made an attempt to use the split method from inside a script. The way I call it is really nothing fancy, it looks like this:


string text="Line 1\nLine 2";
array<string> line=text.split("\n");

AngelScript manual lists it as one of methods supported by strings. It's said to be a version 2.21.0 addition along with substr, findFirst and findLast methods, all of which appear to work correctly as opposed to split.

split() isn't one of the standard string functions, it needs to be registered with RegisterStdStringUtils() from the scriptstdstring add-on.

Advertisement

The reason that split() isn't registered with the call to RegisterStdString() is that it requires both the array and string objects to be regstered first.

Manual: string add-on

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Alright, thanks, sorry for bothering you then. I write scripts for a game but I'm not the person responsible for its AngelScript implementation, which makes me occasionally incorrectly guess who I should report errors to.

No problem. You're welcome to post here any time you wish. :)

May I ask what game it is?

Ideally the game developer should provide its own manual for the script writers, as each application/game will provide their own interfaces and possibly even customizing the script language to suit their needs.

Regards,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

It's Jazz Jackrabbit 2 Plus. In defense of its creators, the scripting manual they provided fulfills its main task, which is explaining JJ2+ implementation of AngelScript and the custom classes, functions and variables it adds. For basic AngelScript usage it only contains a link to the same manual I linked to in the OP, and this is the first time I found anything in it that failed to work within my script, hence my confusion.

This topic is closed to new replies.

Advertisement