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.

DarkBASIC Professional Discussion / types related question

Author
Message
morfeus
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Poland
Posted: 18th May 2003 05:27
why does

if inplay(currentplayer,currentcreature).flying=1 then ...

not work, while

flying=inplay(currentplayer,currentcreature).flying
if flying=1 then ...


works perfectly?
flibX0r
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 18th May 2003 06:08
I don't know, but it happened to me as well. Maybe Raven will have some idea , but i don't really know. But i think its something about user defined types that screw it up.

"But we couldn't do that Mr Flibble," questioned Rimmer. "Who'd clean up the mess?"
--Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, 19" Flat Screen--
pugmartin
23
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 18th May 2003 23:46
Ive had exactly the same problem with my code. Mailed Rich about it but had no reply. Just have to work around it for now i guess

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 19th May 2003 00:17
E-Mail Lee about it...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 19th May 2003 01:48
morfeus try
if (inplay(currentplayer,currentcreature).flying)=1 then ...

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
morfeus
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Poland
Posted: 20th May 2003 03:54
doesn't seem to work in this particular case... well, it seems i'd have to go with this additional variable. thanks anyway.
AsylumHunter
23
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: United States
Posted: 20th May 2003 06:55
I know this problem, and I have a work around...

If you declare your type, for example; as a boolean, it will not work.
If you simply leave your types undeclared they are considered integer types and work perfectly (well, they have in my case), however, any types declared as boolean or float etc., don't work.

Obviously, if you need to test against types using floats you are screwed

So..

Dog(1).Pos.X as float // This doesn't work in if conditions
Dog(1).Pos.X // This works fine in if conditions

AsylumHunter

still falling out of my binary tree most evenings (hicup!)
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 20th May 2003 11:32 Edited at: 20th May 2003 11:34


this code works ... just tested it, test it on your system - if it doesn't work then i'd suggest you upgrade to p4.1

[edit-]
just tested it with all values, works a treat
you can also add arrays as just tested it with 5 seperate dimensions and works fine

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!

Login to post a reply

Server time is: 2026-07-11 04:23:58
Your offset time is: 2026-07-11 04:23:58