Author Topic: [2013 Contest][Axe] Siege  (Read 5268 times)

0 Members and 1 Guest are viewing this topic.

Offline XiiDraco

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 513
  • Rating: +32/-5
  • Forget the numbers, just call me, Recreation.
    • View Profile
    • Black-Lark Games
Re: [2013 Contest][Axe] Siege
« Reply #15 on: October 16, 2013, 01:37:46 am »
OK I thought I might update. I've finished the logic with the AI's for the pixlets finding cutting and bring wood from trees. I've also made them think smarter, so if there aren't any trees nearby they will start to move around randomly until they find some. I also made them not do anything if there isn't a wood cutting building. (they wont cut trees if there is nothing to return too)

So I have figured out that really frustrating bug. I was using an OR. I don't know if it's just me or if it's broken, but OR's and AND's don't seem to work properly. I usually try to avoid them in AXE because of this, but Force of habit made me try and use them. So I have fixed that now. I also figured out why they wouldn't go after the left and right closer edge trees! Instead of using a distance formula, I decided to just calculate how close a tree is X then Y. Since doing so the game is checking into negative numbers which will then return positive for the trees location. (AKA I'll fix that tomorrow)

I'm also going to give a screenie later.

Thanks all!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [2013 Contest][Axe] Siege
« Reply #16 on: October 17, 2013, 01:58:06 pm »
Good luck on this. Can't wait to see screenies, though. Also don't go overboard on features since the contest has a limited timeframe (eg don't do a full Starcraft clone :P)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [2013 Contest][Axe] Siege
« Reply #17 on: October 21, 2013, 12:44:17 pm »
If you were using OR and AND, be careful as these are bitwise, not logical. The logical counterparts are ?? and ? which can also be used as single line conditionals or ternary operators (see Commands.html for details). ;)

Offline XiiDraco

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 513
  • Rating: +32/-5
  • Forget the numbers, just call me, Recreation.
    • View Profile
    • Black-Lark Games
Re: [2013 Contest][Axe] Siege
« Reply #18 on: October 21, 2013, 12:58:24 pm »
Oh! That is quite helpful, so ?? = AND and ? = OR.   Right?

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [2013 Contest][Axe] Siege
« Reply #19 on: October 21, 2013, 04:51:22 pm »
Oh! That is quite helpful, so ?? = AND and ? = OR.   Right?

Other way around. :P

Offline XiiDraco

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 513
  • Rating: +32/-5
  • Forget the numbers, just call me, Recreation.
    • View Profile
    • Black-Lark Games
Re: [2013 Contest][Axe] Siege
« Reply #20 on: October 25, 2013, 02:11:26 am »
So again with AND and OR with axe, I tried something like

If [type]=1??[type]=11
execute command
End

Is this how you do it because I tried this and the types I dont want still perform this command anyway...

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [2013 Contest][Axe] Siege
« Reply #21 on: October 25, 2013, 03:51:32 am »
This is the way you do it. It's weird it doesn't work though since I use and abuse it in all my programs. :/

Offline XiiDraco

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 513
  • Rating: +32/-5
  • Forget the numbers, just call me, Recreation.
    • View Profile
    • Black-Lark Games
Re: [2013 Contest][Axe] Siege
« Reply #22 on: October 25, 2013, 12:25:30 pm »
coul it have to do something with chaining it?

example.
If x=1??x=11??x=21??x=31??x=41??...
command
End

Becuase I have like 10 onjust one.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [2013 Contest][Axe] Siege
« Reply #23 on: October 25, 2013, 04:37:48 pm »
I think there's a maximum of nested conditions like this. Not sure how much.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [2013 Contest][Axe] Siege
« Reply #24 on: October 25, 2013, 05:57:16 pm »
It would throw an error at compile time if that was the issue.

Offline XiiDraco

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 513
  • Rating: +32/-5
  • Forget the numbers, just call me, Recreation.
    • View Profile
    • Black-Lark Games
Re: [2013 Contest][Axe] Siege
« Reply #25 on: October 27, 2013, 07:23:57 pm »
OK, unfortunately I will not be putting this in the contest, for two reasons. 1) I deleted Axe Parser on my calc to get a new version and now I cannot get it on at all. 2) I still haven't gotten the ? and ??'s to work so the program can't function properly.

I'll work on this when I get the time later.
« Last Edit: October 27, 2013, 07:24:05 pm by XiiR3CR34T10N »