Object does not work correctly in executable version

Non-platform specific questions.

Object does not work correctly in executable version

Postby mcavalcanti » Wed Feb 01, 2012 2:22 pm

Hello, guys.

I have three doors that constantly "produces" enemies. In the in-game version, it's ok, but in the Windows executable version, only one door works.

View: Create:
Code: Select all
CreateActor("door", "door", "(none)", "(none)", 0, -300, true);
CreateActor("door", "door", "(none)", "(none)", -200, -300, true);
CreateActor("door", "door", "(none)", "(none)", 200, -300, true);

Door: Timer:
Code: Select all
CreateActor("enemy", "enemy", "(none)", "(none)", 0, 0, false); num+=1;

Please, what can I do to fix it? Thanks.
Mario Cavalcanti
----------------------------
Code is poetry.
User avatar
mcavalcanti
 
Posts: 54
Joined: Fri Jul 22, 2011 1:09 am
Location: Rio de Janeiro, Brazil
Score: 1 Give a positive score

Re: Object does not work correctly in executable version

Postby skydereign » Wed Feb 01, 2012 5:18 pm

How do you create the timer? It sounds like you might be setting the timer for only the first door.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Object does not work correctly in executable version

Postby Troodon » Wed Feb 01, 2012 5:18 pm

Maybe only the first door creates the timer?

edit: Skydereign was faster than me.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Re: Object does not work correctly in executable version

Postby mcavalcanti » Wed Feb 01, 2012 5:39 pm

The timer was created using door's Create Actor event.
Door > Create Actor > Create Timer > enemyGenerator

Then enemyGenerator has an actor var with a Rand to define the enemy type:

Code: Select all
enemyChoose=rand(2);
if(enemyChoose==0){CreateActor("enemy0", "enemy0", "(none)", "(none)", 0, 0, false); num+=1;}
else if(enemyChoose==1){CreateActor("enemy1", "enemy1", "(none)", "(none)", 0, 0, false); num+=1;}
else if(enemyChoose==2){CreateActor("enemy2", "enemy2", "(none)", "(none)", 0, 0, false); num+=1;}

Remembering it is working fine in the editor, but not in the exe. :/
Mario Cavalcanti
----------------------------
Code is poetry.
User avatar
mcavalcanti
 
Posts: 54
Joined: Fri Jul 22, 2011 1:09 am
Location: Rio de Janeiro, Brazil
Score: 1 Give a positive score

Re: Object does not work correctly in executable version

Postby skydereign » Wed Feb 01, 2012 5:50 pm

Odd. The usual reason for something only working in the editor is if the code is relying on something that assumes the actor already already exists while the exe has to create it up, but it seems that isn't the case this time. Not really sure then. Try adding something to the timer event that isn't the CreateActor that way you can see if the timer event is at all triggering in the exe.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Object does not work correctly in executable version

Postby mcavalcanti » Wed Feb 01, 2012 6:43 pm

I changed the CreateActor to PlaySound2 and the result is the same. No loud sounds. Only one sound instance playing.
Is there necessity to use that *getclone2 function?
Mario Cavalcanti
----------------------------
Code is poetry.
User avatar
mcavalcanti
 
Posts: 54
Joined: Fri Jul 22, 2011 1:09 am
Location: Rio de Janeiro, Brazil
Score: 1 Give a positive score

Re: Object does not work correctly in executable version

Postby skydereign » Wed Feb 01, 2012 11:01 pm

That shouldn't necessary as long as you create the timer and choose "Event Actor". Try exporting this ged. It should be similar to what you have, though I did put the CreateTimer into the script editor.
Attachments
timer.ged
(1.64 KiB) Downloaded 62 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Object does not work correctly in executable version

Postby mcavalcanti » Fri Feb 03, 2012 1:00 pm

Sorry about the dealy. Yeah, now it seems to be Ok. Thanks. :-)
Mario Cavalcanti
----------------------------
Code is poetry.
User avatar
mcavalcanti
 
Posts: 54
Joined: Fri Jul 22, 2011 1:09 am
Location: Rio de Janeiro, Brazil
Score: 1 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest