Comments (3)
- What version of SnowState are you on?
- You are saying
fsm.get_current_state()
in the"combat"
state is showing"idle"
? - "the squad variable provided in the obj_unit is undefined" - how is it provided?
from snowstate.
- I am using the latest version of SnowState.
- Yes, the string
"idle"
is copied to my clipboard before the error is displayed. Thecombat
state for theobj_unit
runs fine and doesn't produce any errors, until the squad object is destroyed. - The
squad
variable is provided when the object is created.
Here is how I create the unit object:
var player_squad = instance_create_layer(352, 288, "Map_Instances", obj_squad);
var player_squad_footman1 = instance_create_layer(0, 0, "Combat_Instances", obj_unit, {
properties: footman_properties,
squad: player_squad,
col: 0,
row: 1
});
player_squad.units[0][1] = player_squad_footman1;
Here was the error I was getting:
___________________________________________
############################################################################################
ERROR in
action number 1
of Step Event0
for object obj_unit:
Unable to find instance for object index 100007
at gml_Script_anon____struct___29_gml_Object_obj_unit_Create_0_468____struct___29_gml_Object_obj_unit_Create_0 (line 34) - if (squad.owner_index != obj_game.unit_turns[obj_game.current_unit_turn_index].squad.owner_index) {
############################################################################################
gml_Script_anon____struct___29_gml_Object_obj_unit_Create_0_468____struct___29_gml_Object_obj_unit_Create_0 (line 34)
gml_Script_anon_SnowState_gml_GlobalScript_SnowState_9581_SnowState_gml_GlobalScript_SnowState (line 342) - if (_args == undefined) return _func();
gml_Script_anon_SnowState_gml_GlobalScript_SnowState_9017_SnowState_gml_GlobalScript_SnowState (line 333) - with (__owner) _pyramid(_func, _args);
gml_Script_anon_anon_SnowState_gml_GlobalScript_SnowState_4460_SnowState_gml_GlobalScript_SnowState_4576_anon_SnowState_gml_GlobalScript_SnowState_4460_SnowState_gml_GlobalScript_SnowState (line 162) - exec(event, undefined, _args);
gml_Object_obj_unit_Step_0 (line 3) - fsm.step();
One interesting thing to note was the error was started by fsm.step();
even though the instance was previously destroyed, and to my knowledge that shouldn't happen? The GML manual states:
Also, although the destroy event is performed, the instance is not immediately removed from the game, and it will continue to perform the code contained in the current event. Only when the current event is over will it be removed from the game.
from snowstate.
From the given info, I'm unsure what the error is. But it doesn't look like a SnowState issue.
If you require GML assistance, I suggest asking in the GameMaker Discord server. We might need to see more of the codebase.
If you think it's a SnowState issue, please create a small project demonstrating the issue and send it to me.
Closing the issue for now.
from snowstate.
Related Issues (20)
- Just a couple of small typos in the documentation. HOT 1
- Trigger multiple transitions at a time HOT 1
- state_exists HOT 1
- add_child doesn't "override" HOT 1
- Can't check wildcard transition using transition_exists() HOT 1
- Passing arguments to triggers HOT 1
- Assignment of an empty value - When running using YYC HOT 1
- Allow enums/ types other than strings HOT 6
- Ability to pause timer HOT 3
- Leave event
- Beta Variable not set before reading error HOT 1
- Can not use same name for a SnowState instance event and the owner's instance variable HOT 1
- Allow an option to not trigger enter/leave events using the change() method HOT 1
- Third Level Inherited States Execute Their Inherited Parent's Events Twice
- When running the game after downloading get move_and_collide is a read-only function HOT 6
- Add method for getting the initial state
- inherit() does not support parameters HOT 2
- Internal variables for states HOT 1
- HTML5 support is broken HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snowstate.