Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Turn Based Strategy Code... Not working

Author
Message
Lavalord7
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 19th Oct 2007 21:35 Edited at: 20th Oct 2007 00:23
I have been working on this for a few days and finally found a bug. In this game, a unit is selected. When 'x' is pressed, the selected unit toggles to a different one. Unfortunately, it doesn't do anything. Here's the code:



Edit: Ignore most of my comments, they're weird.

Lavalord7
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 20th Oct 2007 01:33 Edited at: 20th Oct 2007 01:48
I think i may have found the solution... I'm pretty sure the code is just running waaay too fast. I'll try and fix that.

Edit: Nope, thats not it. The Toggle() variable just isn't changing!

Zergei
19
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 20th Oct 2007 06:05 Edited at: 20th Oct 2007 06:07
Sorry for not answering sooner.



Hope my comments do aid you in understanding. Still any question, just ask.

Further on my stuff at...
TurboSquid.com
The3dStudio.com
Lavalord7
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 20th Oct 2007 06:34
Thanks! It works perfectly

Lavalord7
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 20th Oct 2007 06:44 Edited at: 20th Oct 2007 06:45
Unfortunately, i tried to make a movement code, to make the selected unit move with WASD and draining the energy, but for some reason it does nothing. Can someone help with this?



Zergei
19
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 20th Oct 2007 07:12
Speed = 25

...should be...

Speed# = 25

Further on my stuff at...
TurboSquid.com
The3dStudio.com
Lavalord7
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 20th Oct 2007 07:58
Oh, thanks. I can't believe i missed that ...

Hayer
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 20th Oct 2007 21:35
He he, is it the new 'Civilization' you are making?

Lavalord7
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 21st Oct 2007 01:55 Edited at: 21st Oct 2007 04:00
Lol, no it's not that good... It's not even the same style as Civ.

In other news, I tried to implement sliding collision! But it failed... It works the first time I do this (without toggling), but the first time I toggle, it stops working. Can someone please help(again...)



I'm using Sparky's collision Dll.

EDIT: I think the collision sphere is misplaced - the selected unit collides with some random space off to the side(directly to the side) of the other unit.

EDIT 2: Fixed! I just added a few "sc_updateobject" commands.

Lavalord7
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 21st Oct 2007 23:14 Edited at: 21st Oct 2007 23:43
Hmm, thats bizarre. I ran it (without changing anything), and the collision stopped working - the non-selected unit keeps jumping to random places.



EDIT: Fixed.

Login to post a reply

Server time is: 2024-11-25 12:44:22
Your offset time is: 2024-11-25 12:44:22