Broken Code?

Discussion and feedback on Construct 2

Post » Fri Mar 11, 2016 10:55 pm

Message: mast3rd3mon can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi

I recently started making a game similar to that of Pocket Empires. I am just adding the 'battle' code and it now doesn't work. Please could somebody tell me what is wrong with it?: https://www.dropbox.com/s/x67waac608jojnk/Test.capx?dl=0

The 'battle' code is on the E-Forest event sheet and all my variables are on the E-Menu event sheet.

Thanks
B
4
Posts: 10
Reputation: 222

Post » Sat Mar 12, 2016 4:03 am

Though I have yet to play Pocket Empires, interesting concept I must say, Like dungeon crawl.
I've had a quick look and here's what I found:

-You have only two cases where it is either PlayerEndHealth (PEH) <EEH and PEH>EEH.
Since you have no PEH=EEH, as much as you click Fight nothing will happen.
-That is caused by earlier condition where EEH will always equal to PEH and is 0
because SHealth=0 and SArmour=0 making them always 0.

You might want to simplify your code. Try with simpler equations to see if it works
before going deeper. Perhaps using Function to avoid repeated events too.
Have fun!
B
7
S
2
G
1
Posts: 42
Reputation: 1,144

Post » Sat Mar 12, 2016 11:50 am

You said about an earlier condition where EEH will always equal PEH as well as SHealth and SArmour equalling zero. Where abouts is this condition? I cant remember adding such condition.

Thanks for the reply though.
B
4
Posts: 10
Reputation: 222

Post » Sat Mar 12, 2016 12:02 pm

Message: mast3rd3mon can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I figured out why it wasn't working, I was only testing the current layout. For everything to work I had to load the game from the first layout.

I've now hanged the start variables so it works. The problem now is that after I click fight, the text box which displays the amount of gold just disappears. Any ideas?

Here is the link to the updated code: https://www.dropbox.com/s/x67waac608joj ... .capx?dl=0
B
4
Posts: 10
Reputation: 222

Post » Sat Mar 12, 2016 6:52 pm

Yeah, I too figured you might have the variables modified somewhere else.
But still, since you determined the Fight's result by comparing PEH and EEH,
there might be times where PEH=EEH as the game progresses. If you have no
case for it, then that wouldn't do anything. That's what I meant :)

As for the new capx, the link isn't working to me so please upload it again.
B
7
S
2
G
1
Posts: 42
Reputation: 1,144

Post » Sat Mar 12, 2016 11:14 pm

I sorted the chance of PEH=EEH and added an event incase it happens. as for the link, idk why it doesn't work.
B
4
Posts: 10
Reputation: 222

Post » Sun Mar 13, 2016 3:51 am

The link you posted is probably okay, it just that you cannot post clickable one yet.
You can workaround and post the thing behind https://www.dropbox.com/s/
B
7
S
2
G
1
Posts: 42
Reputation: 1,144

Post » Sun Mar 13, 2016 5:15 pm

It isn't clickable as I don't have the rep. Just copy it into a browser.
B
4
Posts: 10
Reputation: 222


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests