Jump to content


Photo

Command Stack usage in GMS


  • Please log in to reply
57 replies to this topic

#1 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 01 May 2012 - 07:25 PM

this? Hello, I've gotten to depending on the command stack setup from-
http://gmc.yoyogames...opic=335600&hl= command stack&st=0

-and from the get go in GMS it has been nonfunctional while either causing a fatal crash or just not seeming to execute is any meaningful way. No flag info is generated to debug with in either case ( that I know of, which doesn't mean much IMO) . So guys am I dense or is it a change in data structures/calls or a simple runner bug causing this? BTW it does work on HTML5 but thats presumably from the Delphi runner still being in use there.
  • 0

lord5.png

 


#2 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 01 May 2012 - 09:34 PM

It was broken in HTML5 and they fixed it. Please report the problem for Studio.
  • 0

#3 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 03 May 2012 - 10:59 PM

Well Shucks, what am I supposed to report dosnt work?
  • 0

lord5.png

 


#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 04 May 2012 - 01:03 AM

I got the latest studio and it does work on windows and on htlm5 output.
  • 0

#5 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 04 May 2012 - 02:56 AM

Really? I'm on the beta updatde channel and its not working... (the code doesnt throw an error, but no actual behavoir occurs) Perhas this is a case of forced reinstall needed?
  • 0

lord5.png

 


#6 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 04 May 2012 - 03:07 AM

Just unintalled, reinstalled studio... No change, windows/Android version of project does not react.
  • 0

lord5.png

 


#7 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 04 May 2012 - 03:18 AM

Just unintalled, reinstalled studio... No change, windows/Android version of project does not react.


Well, you say windows... Like I said, I tried it under windows and HTML5 (not android) and it works.


Open Studio, import the demo (commandstack.gmk). runs fines here.
  • 0

#8 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 04 May 2012 - 07:29 PM

Thats including windows, E.I when you say it works are the arrows on screen moving?
  • 0

lord5.png

 


#9 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 04 May 2012 - 08:14 PM

Thats including windows, E.I when you say it works are the arrows on screen moving?


Yes and the ai is chasing and eating the other guys. and the tank rooms work too,
  • 0

#10 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 04 May 2012 - 10:05 PM

This is interesting...
I just did a clean GMS install on my laptop (has not had GMS on it till now) updated GMS and still no functionaliy of commandstack.gmk outside HTML5 ...
Either you are doing someting very right or I am doing osmething very wrong here...
My GMS list version as 1.0.153 (r11948) Is this somehow not the version you are using?
  • 0

lord5.png

 


#11 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 04 May 2012 - 11:42 PM

Same version.

These bugs are almost impossible to figure out unless the person who experiences it (on his machine) is skilled enough to debug it. And it's not easy to debug someone else's stuff.

If you could use show_debug_message() starting from the top functions and pin point where it's failing...

top of function
show_debug_message("Enter: FunctionName")
...code

bottom of function, before the return statements
show_debug_message("Exit: FunctionName")
  • 0

#12 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 05 May 2012 - 12:18 AM

Ok nice! Thanks icuured, I can see now that the "CommandsPerfom" script is not completing for whatever reason..... I should note that I am refering to a freshly downloaded and otherwise unmodified version of the commandstack tutorial... So there is no code of mine at work here. I do wish someone else could verify this behavior as being uniqe to my household here or rather it working for you is.
  • 0

lord5.png

 


#13 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 05 May 2012 - 04:36 AM

Scratch that, doesnt seem to be the case...... What the heck is going on here?
  • 0

lord5.png

 


#14 NakedPaulToast

NakedPaulToast

    GM Studio/Mac/Win

  • GMC Member
  • 8528 posts
  • Version:GM:Studio

Posted 05 May 2012 - 05:14 AM

I downloaded the .gm81 version, and imported it into GM:S 1.0.153

It worked perfectly with the HTML5 export, with the Blue AI object immediately hunting down the Red enemies.

With both the Windows and Android exports, the screen froze immediately when running, with the Blue AI object and all visible Red enemies frozen with their directional arrows pointing right.
  • 0

keep_crap_150_zpsd7af69c5.png


#15 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 05 May 2012 - 05:24 AM

That is way bizarre. Are the functions even called? With a show_message you can detect what function blows the whole thing to bits. You can also enable the error save log in the game settings. show_debug_messages are logged there too I think.
  • 0

#16 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 05 May 2012 - 06:12 AM

+1 ^ Thats what I get on my machines as well!

Edited by lordvtp, 05 May 2012 - 06:13 AM.

  • 0

lord5.png

 


#17 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 2771 posts
  • Version:Unknown

Posted 05 May 2012 - 08:56 AM

Currently GML in extensions will not be working (though DLL's are in the next version, coming soon) - can you file a bug with a project attached and I will take a look.

Russell
  • 0

#18 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 05 May 2012 - 03:26 PM

This is made in GML and simply uses ds_list, ds_stack and script execute. and user defined command scripts do use other functions, if it gets that deep in the calls.

I don't know where the fault would happen or why it would glitch only for some. Especially in Windows

Added to bug tracker
  • 0

#19 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 21 May 2012 - 10:45 PM

Sorry to necro this, but what bug # did this get? I'm just wondering if its been assigned or passed off, as are allready on the 2nd release candicate and still no dice for this.

Edited by lordvtp, 21 May 2012 - 10:46 PM.

  • 0

lord5.png

 


#20 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 21 May 2012 - 11:22 PM

Sorry to necro this, but what bug # did this get? I'm just wondering if its been assigned or passed off, as are allready on the 2nd release candicate and still no dice for this.


Studio Database, #3181
http://bugs.yoyogame...iew.php?id=3181
  • 0

#21 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 21 May 2012 - 11:56 PM

Thanks man!
  • 0

lord5.png

 


#22 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 25 May 2012 - 04:08 PM

It looks like it wont be fixed. They closed it with the last comment

>>Until you can give a succinct example that exhibits the problem I cannot wade through all this code.


Basically they are asking us to debug their problem for them. In a way, they don't really have a choice in the matter. However I would have liked for them to have said something like

>>We ran it on all the machines we have and it works fine so like you said it's a difficult problem to resolve

A little less "Not our problem" slap in the face.

So it's up to the people that have the problem to try to pin point what the cause is.

I suggest you do what I said in post 11


and for all the user commands, like PatrolTo, you simply do a

show_debug_message("ScriptName"); return 1;


this will at least eliminate any user code problems from the equation. You said the problem is in CommandsPerform. so if you could narrow it dow by putting more show_debug message...

show_debug_message("CommandsPerform ENTER")
show_debug_message("CommandsPerform CHECK1")
if(m_cmdstkscripts = -100) return 0;
if(m_cmdstkdata = -100) return 0;
if(m_cmdlstscripts = -100) return 0;
if(m_cmdlstdata = -100) return 0;

//Call this in your step event
//you may check the return code
//wich will be 0 when all commands have run
//in oder to re-add the default behaviour of your AI.

//if(!CommandsPerform())
//{
//    CommandListAdd(PatrolToXY,...);
//}

show_debug_message("CommandsPerform CHECK2")
if(!ds_stack_size(m_cmdstkscripts)) 
{
show_debug_message("CommandsPerform CHECK2.1")
    if(!ds_list_size(m_cmdlstscripts)) return 0;
show_debug_message("CommandsPerform CHECK2.2")
    if(!ds_list_size(m_cmdlstdata)) return 0;

show_debug_message("CommandsPerform CHECK2.3")    
    ds_stack_push(m_cmdstkscripts,ds_list_find_value(m_cmdlstscripts,0));
show_debug_message("CommandsPerform CHECK2.4")
    ds_stack_push(m_cmdstkdata,ds_list_find_value(m_cmdlstdata,0));
show_debug_message("CommandsPerform CHECK2.5")
    if(ds_list_size(m_cmdlstscripts))
        ds_list_delete(m_cmdlstscripts,0);
show_debug_message("CommandsPerform CHECK2.6")
    if(ds_list_size(m_cmdlstdata))
        ds_list_delete(m_cmdlstdata,0);
}


var data;

show_debug_message("CommandsPerform CHECK3")

if(!ds_stack_size(m_cmdstkdata)) return 0;
show_debug_message("CommandsPerform CHECK4")
if(!ds_stack_size(m_cmdstkscripts)) return 0;

show_debug_message("CommandsPerform CHECK5")
data = ds_stack_top(m_cmdstkdata);
var res;
show_debug_message("CommandsPerform CHECK6" + script_get_name(ds_stack_top(m_cmdstkscripts)))
res = script_execute(ds_stack_top(m_cmdstkscripts), data)
data.action = 3;
if (res = 0) return 1;
show_debug_message("CommandsPerform CHECK6")
CommandStackPop();
show_debug_message("CommandsPerform CHECK7")
if(res = -1) return CommandsPerform();
show_debug_message("CommandsPerform EXIT")
return 1;

  • 0

#23 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 25 May 2012 - 08:47 PM

All right, guess I have no choice. It really is surprising how the was disregarded as any intermittent bug that is also machine specific makes it very hard to 'prove' the existence to a remote party... What do they want a youtube vid showing it not running? Furthermore this is no longer a beta or a purely educational tool anymore, this is support for a paid product for commercial development purposes.


Perhaps we should compare environments/setups between with working/non working users. I have two main PC's (A laptop and a desktop) Both are win7-x64 (one ultimate/one premium) Both have the latest Dx and VB runtimes installed for game usage. Both are nvidia based graphically. This run on neither machine.

I'm going to start adding the debug lines to the stock version of Commandstack since I don't want any problems with my projects diluting the results.
  • 0

lord5.png

 


#24 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 25 May 2012 - 09:07 PM

Ok, this is what I'm seeing in my compile window.
"
CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6DriveToXY
CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6DriveToXY"
rinse and repeat
  • 0

lord5.png

 


#25 Mike.Dailly

Mike.Dailly

    Evil YoYo Games Employee

  • Administrators
  • 4579 posts
  • Version:GM:Studio

Posted 25 May 2012 - 09:13 PM

Oh come on, get real. This would take a long time to debug in its current form, time that could be spent on MANY other bugs. We get a huge number of issues that either give NO example, or full games with comments - it's broken somewhere, fix it. 9 times out of 10, it's the game code that's at fault.

We've said before, this is a new runner, and the order of things have changed. This means old stuff may not work. This is not a bug. It's just the way things now work.

However... if you can point to a specific place, with a specific bug, we'll happily fix it. But asking us to debug a large system simply isn't going to happen, and I'm amazed you think it would.

We're not saying there's no bug, we're saying there's too much code for use to debug in a reasonable time frame. The elements listed are used by us and MANY others properly, so we have no reason to believe they are fault. That said, edge cases can ALWAYS happen, but for this to be found, you need specific cases, not a general "this doesn't work". Find the edge case, and we'll fix it.
  • 0

#26 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 25 May 2012 - 10:55 PM

If I had some idea as to what/why/where the reasons this does not work as intended, I wouldn't need a bug report. If have yet to find any actionable information as to the nature of the fault. Even in the early beta the best I could Get was a hard crash with NO data generated by the crash. Indeed this is a different runner, and in some way probably dealing with data structure handling, variable handling what have you... What is not operating correctly lies at the runner level and is not exposed. If there are undocumented changes to the supported data structs that is not something we can just 'fix' and is not going to be apparent.

I can only assume since it was deemed 'no example, not reproducible' that the code works as described in your systems. The very fact that the same code does NOT behave identically with a given runner on different systems should be a major red flag. Were this a question of one system or user having this occur the course of action would be so much simpler.

Edited by lordvtp, 25 May 2012 - 10:56 PM.

  • 1

lord5.png

 


#27 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 25 May 2012 - 11:00 PM

Chill mike. I stated in tracker that I could not make the thing simpler and that it would be quasi impossible to debug if you don't have the problem on your end. It's a complex problem we are having here. A WTF moment that only happens on some machines. Of course the Studio Product will be pointed too first as the thing works on all other GM versions including GM::HTML5 and Studio but not for this guy. The demo works, I can't simplify it more than that..

Perhaps you can peruse discretely as I remote debug this thing. See what someone with 20+ years experience in debugging can do....

@lordvtp. OK, I'm doing this drunk so bare with me...

Your output is promising, at least it shows it's not locked and it's actually doing something and that is good. This shows the program at least finds a script to run (MoveToXY)... And since you say the AIs don't move then at least we are almost on the verge to finding the problem


The problem must be arround this code or in MoveToXY itself
data = ds_stack_top(m_cmdstkdata);
show_debug_message("CommandsPerform CHECK6" + script_get_name(ds_stack_top(m_cmdstkscripts)))
IT GOT THIS FAR
add this right after
show_debug_message("CommandsPerform CHECK6.2 data is" + string(data))

but did it execute THIS!??
res = script_execute(ds_stack_top(m_cmdstkscripts), data)
add right after
show_debug_message("CommandsPerform CHECK7 " + script_get_name(ds_stack_top(m_cmdstkscripts)) + " returns " + string(res))

to see if the code proceeds on after the call and to see if res is set to the return specified by the call

I assume you did not put
show_debug_message("MoveToXY ENTER")
at the top of the MoveToXY script as I said in my other post, because we should see a
MoveToXY ENTER entry in the debug output... If you did add it then the problem is definitely on the
res = script_execute(ds_stack_top(m_cmdstkscripts), data)
line.


Anyway, for now, here is the movetoXY debug version...
show_debug_message("    MoveToXY ENTER")

//CommandStackPush (MoveToXY, destx, desty, speed)
//This command will move to the destination point, 
//it will slow down when it gets close to the destination if
//the speed would make it jump over the destiantion and then stop
//data.arg1 = x;
//data.adr2 = y;
//data.arg3 = speed;

//return 0 when not done, 1 when done, -1 when done and hurge to proceed with the next event right away

//A data objects is provided to store your information for the command
var data;
data = argument0;

//A flag tells you if you are initializing, 
//starting the action, 
//continuing the action 
//or done with the command
if(data.action = 0) //pushed (added to stack)
{
show_debug_message("    MoveToXY Push, data is : " + string(data))
    //init vars/create stuff
    data.TargetX = data.arg1;
    data.TargetY = data.arg2;
    data.MoveSpeed = data.arg3;
show_debug_message("    MoveToXY Push EXIT with 1"))
    return 1;
}
else if(data.action = 1) //poped (removed from stack)
{
    //done... free stuff
show_debug_message("    MoveToXY Pop EXIT with 1"))
    return 1;// done
}
else if(data.action = 2) //first actual "perform the action" call
{
    //start performing
show_debug_message("    MoveToXY Start Perform Command"))
}
else if(data.action = 3) //subsequent call
{
    //keep performing
show_debug_message("    MoveToXY Still Perform Command"))
}


//start/keep performing it is then...
pd = point_distance(x,y,data.TargetX,data.TargetY);
show_debug_message("    MoveToXY Distance is " + string(pd)))

if(pd = 0) 
{
    speed = 0;
show_debug_message("    MoveToXY Distance Reached, EXIT return -1")
    return -1;
}

show_debug_message("    MoveToXY move_towards_point at speed " + string(min(data.MoveSpeed,pd)))

move_towards_point(data.TargetX,data.TargetY, min(data.MoveSpeed,pd));

show_debug_message("    MoveToXY EXIT return 0")
return 0;// not done


Please report back with the new output. This should show if script execute is working, if the data instance is valid, if the arguments are passed, if the return is passed on, if the point_distance is working....

I appreciate your help on this
  • 0

#28 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 25 May 2012 - 11:16 PM

Ok, Changes to MoveToXY have been made but.....

Output is identical to before! none of the new debug msgs show up!
  • 0

lord5.png

 


#29 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 26 May 2012 - 04:01 AM

I'm back from the bar...
OK, now double check by calling the script directly...

change
res = script_execute(ds_stack_top(m_cmdstkscripts), data)

to
res = MoveToXY(data);

then to
res = script_execute(MoveToXY,data);

See if one of them works calling the MoveToXY

I'm starting to suspect script_execute a little....
data could also be the cause...

If I'm right you should see the debug messages in the first change but not after the second change

[edit] typos and code changes
  • 0

#30 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 26 May 2012 - 04:13 AM

Ok!

When Doing res = MoveToXY(data);

CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6PatrolToXY"
MoveToXY ENTER
MoveToXYStill Perfom Command
MoveToXY Distance is 390.61
MoveToXY move_towards_point at speed 0
MoveToXY EXIT return 0



When Doing - res = script_execute(data);



ERROR in
action number 1
of Step Event0
for object EnemyAIObj:

Trying to execute non-existing script.


I state again that I have changed no other code or scripts then you have specified!
  • 0

lord5.png

 


#31 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 26 May 2012 - 04:23 AM

See my modified code, sorry about that.

2nd change
res = script_execute(MoveToXY,data);
  • 0

#32 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 26 May 2012 - 04:36 AM

When Doing res = MoveToXY(data);

CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6PatrolToXY"
MoveToXY ENTER
MoveToXYStill Perfom Command
MoveToXY Distance is 390.61
MoveToXY move_towards_point at speed 0
MoveToXY EXIT return 0



When Doing - res = script_execute(MoveToXY,data);

CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6PatrolToXY"
MoveToXY ENTER
MoveToXYStill Perfom Command
MoveToXY Distance is 390.61
MoveToXY move_towards_point at speed 0
MoveToXY EXIT return 0



As you see now both now have same effect (and still no motion lol)
BTW I should note that you are a saint for doing this!
  • 0

lord5.png

 


#33 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 26 May 2012 - 05:11 AM

I'm blushing....


OK, well still a few things to eliminate.

We know MoveToXY is called, though it's odd it was not called before. If you remember you got the name from script on the stack from seeing
CommandsPerform CHECK6PatrolToXY

Yet is was not called at that point. But calling it directly works, calling it with script_execute worked. but why the hell not from
res = script_execute(ds_stack_top(m_cmdstkscripts), data)

change
var res;
show_debug_message("CommandsPerform CHECK6" + script_get_name(ds_stack_top(m_cmdstkscripts)))
res = script_execute(ds_stack_top(m_cmdstkscripts), data)
show_debug_message("CommandsPerform CHECK7 " + script_get_name(ds_stack_top(m_cmdstkscripts)) + " returns " + string(res))

to
var fn; fn = ds_stack_top(m_cmdstkscripts);
var res;
show_debug_message("CommandsPerform CHECK6" + script_get_name(fn))
res = script_execute(fn, data)
show_debug_message("CommandsPerform CHECK7 " + script_get_name(fn) + " returns " + string(res))

then to
var fn; fn = MoveToXY;
var res;
show_debug_message("CommandsPerform CHECK6" + script_get_name(fn))
res = script_execute(fn, data)
show_debug_message("CommandsPerform CHECK7 " + script_get_name(fn) + " returns " + string(res))


I mean it's really screwy...

Also you AI should have moved, you see, data holds the speed as an argument inside 2 data instance variable to travel and seeing "at speed 0" tells me data is wrong.

Hey, wait, I though there was debug messages for data in bot the CommandPerform and the MovetoXY!?

Post 27, add
show_debug_message("CommandsPerform CHECK6.2.2 data is" + string(data))
right before the
res = script_execute
call


change
show_debug_message(" MoveToXY Enter" + string(data))
to

show_debug_message(" MoveToXY Enter" + string(data))
show_debug_message(" MoveToXY Push, data is : " + string(data))



There are other functions involved in the system. Eh, wait a minute.... The demo is on demo room0... it uses EnemyAI and SimpleAI objects. they use DriveToXY, not MoveToXY... so why is MoveToXY even Called?

This is familiar problems when having stack faults....

Add this in CommandStackPush script
show_debug_message("CommandStackPush ScriptIndex: " + string(argument0));
show_debug_message("CommandStackPush ScriptIndex: " + script_get_name(argument0));

and this int CommandsPerform
before the script_execute call

show_debug_message("CommandsPerform ScriptIndex: " + string(ds_stack_top(m_cmdstkscripts)));
show_debug_message("CommandsPerform ScriptIndex: " + script_get_name(ds_stack_top(m_cmdstkscripts)));

the 2 new debug entries should display the same script value

the 2 new entries should display the same script index and the same script name...
  • 0

#34 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 26 May 2012 - 05:44 AM

When Doing -

var fn; fn = ds_stack_top(m_cmdstkscripts);
var res;
show_debug_message("CommandsPerform CHECK6" + script_get_name(fn))
res = script_execute(fn, data)
show_debug_message("CommandsPerform CHECK7 " + script_get_name(fn) + " returns " + string(res))



CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6PatrolToXY
CommandsPerform CHECK7PatrolToXY returns 0

When

var fn; fn = MoveToXY;
var res;
show_debug_message("CommandsPerform CHECK6" + script_get_name(fn))
res = script_execute(fn, data)
show_debug_message("CommandsPerform CHECK7 " + script_get_name(fn) + " returns " + string(res))




CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6PatrolToXY"
MoveToXY ENTER
MoveToXYStill Perfom Command
MoveToXY Distance is 390.61
MoveToXY move_towards_point at speed 0
MoveToXY EXIT return 0
CommandsPerform CHECK7PatrolToXY returns 0

Changes as per post 27 are in effect in, no debug msg from data there...

And when ALL the changes you listed are made

FATAL ERROR in
action number 1
of Step Event0
for object EnemyAIObj:

############################################################################################
VMError!! Occurred - Push :: Execution Error - Variable Get data
at gml_Script_MoveToXY (line 0) - show_debug_message(" MoveToXY Enter" + string(data))
############################################################################################
Self Variables :
100008( m_cmdstkscripts ) = 16.000000
100009( m_cmdstkdata ) = 17.000000
100010( m_cmdlstscripts ) = 16.000000
100011( m_cmdlstdata ) = 17.000000
  • 0

lord5.png

 


#35 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 27 May 2012 - 01:27 AM

Looks like the patrol and the moveto have the same index number

can you do a

show_debug_message(string(MoveToXY))

show_debug_message(string(PatrolToXY))

they may be the same value. which means the script loading in GM Studio screwed up setting the script_index for both script as the same value....
  • 0

#36 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 27 May 2012 - 05:11 AM

Ok, i did some rearanging I must have been to tired last night and as calling for data before it was defined as argument..

CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6MoveToXY
CommandsPerformCHECK6.2.2 data is100064
CommandsPerform ScriptIndex: 17
CommandsPerform ScriptIndex: PatrolToXY
15
MoveToXY ENTER100064
MoveToXY Push,data is :100064
MoveToXYStill Perfom Command
MoveToXY Distance is 390.61
MoveToXY move_towards_point at speed 0
MoveToXY EXIT return 0
CommandsPerform CHECK7MoveToXY returns 0



So I gota ask, If distance > 0 as per -

pd = point_distance(x,y,data.TargetX,data.TargetY);
show_debug_message(" MoveToXY Distance is " + string(pd))
if(pd = 0)
{
speed = 0;
return -1;
}

Why do I see - MoveToXY move_towards_point at speed 0 ?
  • 0

lord5.png

 


#37 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 27 May 2012 - 05:16 AM

I added -

data.MoveSpeed = 5;

near the end of MoveToXY and sure enough the onscreen objects now moved! (at 5 lol); therefore....
why isnt "data.MoveSpeed = data.arg3;" working as desired?
  • 0

lord5.png

 


#38 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 27 May 2012 - 05:39 AM

data.MoveSpeed = 5; does nothing for a otherwise clean version of commandstack...scripts not being called there i guess heh...
  • 0

lord5.png

 


#39 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 27 May 2012 - 03:53 PM

OK, I'll verify some stuff here... I'll send you a copy of a sturdier debug enabled code later on today.
  • 0

#40 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 28 May 2012 - 02:57 AM

Here I put debugging, stack tracing like feature in the code

http://www.host-a.ne...dstackdebug.gmk

Import it in Studio, run it, say 1 when it asks for the number of AIS


You will have 2 instances running, the red and the blue. Here is the expected output...

100001 IN CommandsCreate

100001 OUT CommandsCreate

100015 IN CommandsCreate

100015 OUT CommandsCreate

100001 IN CommandsPerform

100001 OUT CommandsPerform

100001 IN CommandStackPush

100001   IN PatrolToXY

100001   OUT PatrolToXY

100001 OUT CommandStackPush

100015 IN CommandsPerform

100015 OUT CommandsPerform

100015 IN CommandStackPush

100015   IN DriveToXY

100015   OUT DriveToXY

100015 OUT CommandStackPush

100001 IN CommandsPerform

100001   IN PatrolToXY

100001   OUT PatrolToXY

100001 OUT CommandsPerform

100015 IN CommandsPerform

100015   IN DriveToXY

100015   OUT DriveToXY

100015 OUT CommandsPerform

100001 IN CommandsPerform

100001   IN PatrolToXY

100001   OUT PatrolToXY

100001 OUT CommandsPerform

and on and on

I will update the gmk with new debug info when you report back
  • 0

#41 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 28 May 2012 - 03:43 AM

Holy Crap! Things worked as expected!

Output as Follows -

100000 IN CommandsPerform
100000 OUT CommandsPerform
100000 IN CommandsStackPush
100000 IN PatrolToXY
100000 OUT PatrolToXY
100000 OUT CommandStackPush

- repeat Except for when the two instances interact..

You know I really wish they'd lets us copy/paste from the compile window.

So seeing all this, what has this revealed about the new runner and how major is this going to impact the more complex systems in game maker?
  • 0

lord5.png

 


#42 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 28 May 2012 - 03:50 AM

Are you saying the AI walks as it should (I'm conflicted with the 2 statements)

>>Holy Crap! Things worked as expected!
>>- repeat Except for when the two instances interact..

I need to see more lines from the output (paste the output in code tags too). a few pages from the debug window should do. Right now I only see the boot sequence of the AIs

You have to pause the game in the debugger first...
  • 0

#43 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 28 May 2012 - 04:57 AM

Yes the AI's Moved with this new file!

Posted Image

Ok I hope this IS what you wanted, I cant seem to be able to copy/paste from any of the debug or compile windows...
  • 0

lord5.png

 


#44 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 28 May 2012 - 05:15 AM

Update, this version works for me on windows and android as well! Soo, what changed? ::lmao::
  • 0

lord5.png

 


#45 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 28 May 2012 - 05:31 AM

What changed? Nothing... Well there is a boot room now that allows me to setup the debug system before the game gets debugged and the debug functions that I added.


Could it be GMS screwed up in the import process?


Do you have GM7,8,8.1? Try adding a new script in the original GMK with GM8 or whatever and try to import that file in GMS...

It's a shame you cant copy and paste from the debug box. They replaced it with a list box
  • 0

#46 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 28 May 2012 - 05:45 AM

I have 8.1... but adding a script then importing didint reveal anything...
buuuuutt... We do know that GMS uses the first room you load to set a lot of things now doesnt it?
Second, I became aware of this problem initially when I added it too my own project in gmhtml5 beta/ then studo beta as it became available... To this moment it still functions in the delphi runner and in HTML but does not perform actions in C++ windows /android. I mention this because i did not import the scripts, I manually copyied and added them.. No imports involved.
  • 0

lord5.png

 


#47 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 28 May 2012 - 06:00 AM

It would be interesting if you distributed the project file instead on your end rather then the original GMK to see it that made a differance. IE a no 'foreign' import... if your unaltered GMS project worked as intended on my end it would prove something at least. Perhaps you could just rar the whole dir?

Edited by lordvtp, 28 May 2012 - 06:02 AM.

  • 0

lord5.png

 


#48 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 28 May 2012 - 06:08 AM

Oh.... You should have mentioned you manually added the stuff in...

I'm gonna ask a few questions and tell you to do things and answer concisely...

1) Did you ever run the original demo as an import in GMS? I know nakedpaultoast probably did, he had problems with it from that point on, post #14.

2) Can you run the original demo as import in GMS? do you have the problem?

3)Could it be you made a typo in the function names while you manually added them. Could there be a leading or trailing space in there?

4)Is it possible the code changed when it was pasted in, a problem similar to what happens on the forum...

if(this=that) somefunction(sdfg,asf,asfd,asfd,asfd,as,fdas,fdas,fdasf,asffasdf,asf,asf)

see how the forum changed the formatting
if(this = that) somefunction(sdfg, asf, asfd, asfd, asfd, as, fdas, fdas, fdasf, asffasdf, asf, asf)


Maybe some code got pushed outside of an if statement....
  • 0

#49 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16913 posts
  • Version:GM:Studio

Posted 28 May 2012 - 06:13 AM

Here is the gmz
http://www.host-a.ne...ommandstack.gmz
  • 0

#50 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 749 posts
  • Version:GM:Studio

Posted 28 May 2012 - 06:17 AM

1 - When i say unaltered original or modified debug I am refering to the original demo. That is what I have been using for this whole process. As released it functions for me in 8.1 / html5 / pre-studio delphi runners ...

2 - Sooo.. the original demo does not function imported to GMS for me (on any machine).

3- If my own project that I copy pasted over was that kind of fault, it wouldnt run in the other runners =)
  • 0

lord5.png

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users