Memory view and native structs support

Started by
2 comments, last by HoShiMin 3 years, 2 months ago

Hi, guys!

Assume, I need to read and edit any native structs from AngelScript in a C-like manner using it's prototype.
For example, I need to give an interface allowing users to declare their own struct prototypes (like CTypes in Python).

How could it be achieved?

Advertisement

If I understood it correctly you want to provide the ability for the script to manipulate memory, and define the structure for the memory to help with that.

You should be able to do this quite easily by doing something similar to the dictionary add-on. Though add options to define the order and position of each attribute within the structure, and then also add functions to set/update the address of the memory block that should be read/updated via the object. You may also want to add safety checks on that so the script won't be able to read/write to any memory location (unless of course you wish to give total freedom to the script writer).

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

WitchLord said:
unless of course you wish to give total freedom to the script writer

Seems I wish ?

Yes, I got your idea, thank you!

This topic is closed to new replies.

Advertisement