239 questions
0
votes
0
answers
31
views
How would I make butterflies that move around semi-randomly in Construct-3?
I'm making a small, simple game where the player catches butterflies. How could I make the butterflies move around somewhat randomly but try to avoid the player (and avoid getting stuck)? I am making ...
0
votes
1
answer
95
views
Converting construct.Struct to Formatted JSON in Python
I'm trying to convert a construct.Struct object with nested Container objects to a serialized JSON. Can someone help me? Converting the object to a dict will also work
I tried to develop a recursive ...
0
votes
0
answers
82
views
Specifying a Conditional (Switch) field in Python Construct that depends on a look-ahead value
I'm building a parser for a (slightly bizzare) format that defines the tag of a data field after the value record. It is guaranteed that the value field would always be 4 bytes interpreted depending ...
0
votes
0
answers
60
views
Can I make Bitswapped Enum in Python Construct object?
I using Python Construct module for build\parse binary objects.
Is it possible to swap Enum somehow?
Because I have wrong order of my "Configuration" Enum, also, "Side" Enum works ...
0
votes
1
answer
80
views
SPARQL: Construct only triples that are not already in the graph
I would like to implement a SPARQL construct query which constructs only triples that are not already in the graph.
Consider the following example graph:
@prefix crm: <http://www.cidoc-crm.org/...
0
votes
1
answer
67
views
PascalString() missing 1 required positional argument: 'encoding'
PascalString() missing 1 required positional argument: 'encoding'
I am trying to run constructs.py but it just shows an error and I don't know how to fix it
This isn't my script
constructs.py
from ...
-1
votes
2
answers
193
views
How to initialize char[] in a struct with constexpr char[] using initializer list?
I have a struct like:
constexpr char defaultName[6] = "Hello";
struct MyStruct{
char name[6];
int val;
};
Now I want to initialize the struct using initializer list as following:
...
2
votes
1
answer
126
views
Why the constructor of the map allow us to pass a comparator object in the parameter?
#include <map>
#include <string>
class A_comparator
{
public:
template <typename T>
bool operator()(const T& lhs, const T& rhs) const
{
// Defines a ...
-2
votes
1
answer
303
views
usage of using keyword in struct C++ [duplicate]
I created an exception like this in my header_file run.h
struct invalid_assignment : std::runtime_error {
using std::runtime_error::runtime_error;
};
I dont understand the using std::...
0
votes
1
answer
306
views
Construct 2/3: Continuous Loop Function?
Using Construct 3 to build a game.
I want to change this function in the code below (which just randomly assigns a frame count in an array) to something that isn't random, but instead loops in order ...
0
votes
1
answer
125
views
With Construct-Package: RepeatUntil total lenght of subconstruct
Let's say I have:
numResults (Int16ul)
resultItems[numResults]
where the resultItems is constructed like:
ID (does not always increase)
strLen
my_str[strLen]
Now I understand, that I have to use ...
2
votes
3
answers
79
views
How to add a try & except construct so that the script ignores that there is no file
I don't really know the Python language, so I'm asking for help from experts. I have a simple script and I need to add a construct to it
try:
except:
this is necessary so that the script ignores that ...
1
vote
2
answers
2k
views
Assigning a class variable in class definition versus at class instantiation
What are the ramifications of assigning a class variable when defining the class versus in the class constructor? Is the variable assigned in the class definition accessible by all class instances?
...
0
votes
0
answers
1k
views
doctrine entity __constructor() never called?
Is there no __constructor() to run on an entity class i doctrine (symfony 5)?
I'm trying to initialize some default values for my entity, and then override them with parameters from the services.yaml ...
0
votes
1
answer
889
views
Reading config.json file in PHP
I would like to ask what could be the problem with my code.
The situation is that I would like to read some data from a config.json file, and I have to use it in a class. My idea is to use a ...