Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Crashing with OpenAs  (Read 3055 times)

0 Members and 1 Guest are viewing this topic.

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Crashing with OpenAs
« on: October 13, 2009, 07:27:59 PM »

Hi, i just wanna try some actions with external files, but when i use OpenAsText or OpenAsBinary, WME crush and it writes :
Code: WME Script
  1. -----------------------------------------------------------------
  2. ---------- wme 1.8.011 crash report: 13-10-2009, 20:16 ----------
  3. -----------------------------------------------------------------
  4. wme.exe caused a EXCEPTION_ACCESS_VIOLATION in module wme.exe at 001B:004403D8
  5. EAX=00000007  EBX=00C6DE8A  ECX=00000000  EDX=00C70531  ESI=00000000
  6. EDI=00000000  EBP=003D4758  ESP=0012FD88  EIP=004403D8  FLG=00010202
  7. CS=001B   DS=0023  SS=0023  ES=0023   FS=003B  GS=0000
  8. Stack trace:
  9. 001B:004403D8 (0x003D4758 0x00000000 0x003D4C80 0x00000000) wme.exe
  10. 001B:003D0101 (0x00442740 0x00401120 0x004045E0 0x00442480) <UNKNOWN>
  11. 001B:00404C90 (0xCCCCCCCC 0xCCCCCCCC 0x0424448B 0x0824548B) wme.exe
  12. 001B:CCCCCC00 (0x00000000 0x00000000 0x00000000 0x00000000) <UNKNOWN>
  13.  

My script is(just for testing) :

Code: WME Script
  1. on "Talk"
  2. {
  3. actor.Talk("something");
  4. var TestBIN = File("MotoCars_1_0.exe");
  5. TestBIN.OpenAsBinary(1); // 1..open for reading, 2..open for writing
  6. Sleep(10000);
  7. TestBIN.Close();
  8.  Sleep(1500);
  9.  actor.Talk("yeaaaah");
  10. }

it is crashing after actor say "something", no errors in debug console... i tryed OpenAsText with .txt files, but its crashing with same error... pls help me  :(
« Last Edit: October 14, 2009, 08:22:53 AM by Jyujinkai »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Crashing with OpenAs
« Reply #1 on: October 13, 2009, 09:27:13 PM »

It should be:

var TestBIN = new File("MotoCars_1_0.exe");
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Re: Crashing with OpenAs
« Reply #2 on: October 14, 2009, 04:04:49 PM »

THX Mnemonic, i just pretend that NEW will be only for new files, wich i want to create :P but i was worng.
Now i got it right, but when script have to proceed, nothing happens.......i do not know nothing about WME cooperation with other files, but i pretend if i write this script :
Code: [Select]
on "Talk"
{
actor.Talk("Another Test");
var TestBIN = new File("data\icytower1.3\icytower13.exe");
TestBIN.OpenAsBinary(3);
TestBIN.SetPosition(0,0);
TestBIN.ReadString;
 Sleep(1500);
 actor.Talk("yeaaaah");

something must happen...game will be opened in WME game window for example or i don't know.
Goal of this testing is to learn WME cooperation with .exe files, so my friend can write some code in Java for PDA or mobile phone and i just want it to import to a game, if player for example click on the phone, .exe file will open (PDA) and he can work with PDA, it will write the data player chanded to a TXT file,and WME will be reading from this TXT files so actions made in his Programm will affect game in WME... i hope u will understud me :P
sorry for my english  ::)
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Crashing with OpenAs
« Reply #3 on: October 15, 2009, 07:51:45 AM »

Ok, now you got me completely confused.

Firstly, ResdString is a method, so the line should read TestBIN.ReadString();
Secondly, you do realize the File object is meant for reading the CONTENTS of files, right? There's absolutely no point in reading content of exe files. if you want to RUN exe, you'd use Game.OpenDocument(). But you will get problems with full-screen games.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Re: Crashing with OpenAs
« Reply #4 on: October 15, 2009, 03:39:00 PM »

sorry, i was using wrong command  ;D i am really noob in WME so some of my questions can sound to you like dumb  ;D
anyway, is there any other option to open file(probably .exe) with Game.OpenDocument(); and disable minimizing or set some location where will this window open ? or is there any other command for this ?
THX for informations, it really helps me !
Logged
 

Page created in 0.028 seconds with 25 queries.