Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
script.h
Go to the documentation of this file.
1 // script [hsdt] - Tag Definition //
3 // -------- //
4 // Part of the Blamite Game Engine //
5 // Copyright (c) Elaztek Studios 2013 - 2023 //
7 
8 
9 #pragma once
10 
11 #include <string>
12 #include <blam/api/v1/types/tags.h>
14 
15 #ifndef BLAM
16 #define BLAM
17 #endif
18 
19 #define tag_hsdt "hsdt"
20 
21 enum class variable_type : uint32_t
22 {
23  int,
24  string,
25  real,
26  bool,
27 };
28 
29 
30 #pragma pack(push, 1)
31 struct script
32 {
33  TAG_ENUM(type,
34  {
35  hsc,
36  cpp,
37  cs,
38  vs,
39  });
40 
41  TAG_BLOCK(hs_script_data,
42  {
43  });
44  TAG_BLOCK(c_script_data,
45  {
46  data_reference extension;
47  data_reference script_class_name;
48  TAG_BLOCK(script_methods,
49  {
50  data_reference name;
51  variable_type return_type;
52  TAG_BLOCK(parameters,
53  {
54  data_reference name;
55  variable_type type;
56  });
57  });
58  });
59  TAG_BLOCK(c_script_data,
60  {
61  });
62  TAG_BLOCK(visual_script_data,
63  {
64  });
65 };
66 #pragma pack(pop)
67 
69 {
70 public:
72  {
73  class_name_long = "script";
74  class_name_short = "hsdt";
75  version = 0;
76 
77  revisions = {
78 
79  };
80 
81  tag_size = 132;
82 
83  fields =
84  {
85  new Enum32Field("type", "",
86  {
87  "haloscript",
88  "c++ script",
89  "c# script",
90  "visual script",
91  }),
92  new BlockField(0, "hs script data", "",
93  {
94  new CommentField("not yet implemented",
95  ""),
96  }),
97  new BlockField(96, "c++ script data", "",
98  {
99  new CommentField("C++ Script Data",
100  ""),
101  new DataReferenceField("extension", ""),
102  new DataReferenceField("script class name", ""),
103  new BlockField(68, "script methods", "",
104  {
105  new DataReferenceField("name", ""),
106  new Enum32Field("return type", "",
107  {
108  "int",
109  "string",
110  "real",
111  "bool",
112  }),
113  new BlockField(36, "parameters", "",
114  {
115  new DataReferenceField("name", ""),
116  new Enum32Field("type", "",
117  {
118  "int",
119  "string",
120  "real",
121  "bool",
122  }),
123  }),
124  }),
125  }),
126  new BlockField(0, "c# script data", "",
127  {
128  new CommentField("not yet implemented",
129  ""),
130  }),
131  new BlockField(0, "visual script data", "",
132  {
133  new CommentField("not yet implemented",
134  ""),
135  }),
136 
137  };
138  }
139 };
140 
141 namespace Blam::Content::Tags
142 {
143  BLAM script* GetScriptTag(std::string tag_path);
144 }
variable_type::int
@ int
variable_type
variable_type
Definition: script.h:21
ScriptTagClass::ScriptTagClass
ScriptTagClass()
Definition: script.h:71
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:181
variable_type::real
@ real
DataReferenceField
Class representing a data reference, or dataref for short.
Definition: dataref.h:19
BLAM
#define BLAM
Definition: script.h:16
variable_type::bool
@ bool
Enum32Field
Definition: enum.h:45
Blam::API::v1::Tags::GetTagData
BLAM_EXT_API BlamTagData * GetTagData(std::string tag_path)
Retrieves information for a given tag.
Definition: api.cpp:208
BlamTagClass::fields
std::vector< BlamTagClassField * > fields
A series of tag fields that store the layout of the tag.
Definition: tags.h:209
BlamTagClass::revisions
std::vector< BlamTagClassRevision > revisions
List of all tag class revisions. Does not get written to tags, but is included in plugin files.
Definition: tags.h:208
plugins.h
BlamTagClass::class_name_short
std::string class_name_short
The short, 4-character name of the tag class.
Definition: tags.h:206
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tags.h:207
BlamTagClass::class_name_long
std::string class_name_long
The longer class name. Typically shown alongside short name for user-friendliness.
Definition: tags.h:205
uint32_t
unsigned int uint32_t
Definition: stdint.h:17
ScriptTagClass
Definition: script.h:68
variable_type::string
@ string
Blam::Content::Tags::GetScriptTag
BLAM script * GetScriptTag(std::string tag_path)
Definition: script.cpp:13
data_reference
Structure representing a data reference.
Definition: tags.h:342
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tags.h:210
script::TAG_ENUM
TAG_ENUM(type, { hsc, cpp, cs, vs, })
BlamTagData::address
void * address
The address pointing to the start of the tag's data.
Definition: tags.h:132
script::TAG_BLOCK
TAG_BLOCK(hs_script_data, { })
tags.h
script.h
BlamTagData
Class used to contain and access tag data.
Definition: tags.h:125
CommentField
Class representing a comment field.
Definition: comment.h:29
BlockField
Class representing a tag block field, also sometimes referred to as a struct or reflexive in the modd...
Definition: block.h:19
script
Definition: script.h:31
BlamTagClass
Class representing a tag class.
Definition: tags.h:202
tag_hsdt
#define tag_hsdt
Definition: script.h:19
api.h
BlamTagData::tag_class
std::string tag_class
The tag's short class name.
Definition: tags.h:146