Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 4 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating script support, taking requests
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#31
RE: Updating script support, taking requests

(08-28-2013, 05:26 PM)Patrik Wrote: Some nice suggestions so far. Keep them coming! Smile

(08-27-2013, 12:29 PM)JustAnotherPlayer Wrote: Can you make the if-else function that the parameter could turn Integers to Bools and vice-versa?

Could you rephrase this? Not sure I understand exactly.

Make the if-else function to be able to interpret from Bools too instead of just Integers.

PHP Code: (Select All)
if(1

could be the same as

PHP Code: (Select All)
if(true

EDIT:
Patrik, the source of this problem came from YC in this post
http://www.frictionalgames.com/forum/thr...#pid217490

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 08-29-2013, 07:51 AM by PutraenusAlivius.)
08-29-2013, 07:45 AM
Find
felixmole Offline
Senior Member

Posts: 482
Threads: 7
Joined: Dec 2012
Reputation: 10
#32
RE: Updating script support, taking requests

(08-27-2013, 12:29 PM)JustAnotherPlayer Wrote: Can you make the if-else function that the parameter could turn Integers to Bools and vice-versa?

This is inherent to the AngelScript language, use casts (even though it's bad) to overcome these errors.
08-29-2013, 08:44 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#33
RE: Updating script support, taking requests

Hold on, change the if-else AND the switch statement to accommodate this please.

"Veni, vidi, vici."
"I came, I saw, I conquered."
08-29-2013, 01:12 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#34
RE: Updating script support, taking requests

(08-29-2013, 01:12 PM)JustAnotherPlayer Wrote: Hold on, change the if-else AND the switch statement to accommodate this please.

That's not necessary

bool IntToBool (int x)
{
    if (x != 0) return true
    else return false
}

if (IntToBool(number)) ...

(This post was last modified: 08-29-2013, 04:53 PM by Adrianis.)
08-29-2013, 01:40 PM
Find
fancreeper Offline
Senior Member

Posts: 402
Threads: 3
Joined: Feb 2013
Reputation: 6
#35
RE: Updating script support, taking requests

I have a little question.Is it possible to make outside levels,like in AAMFP,with the updated version of ATDD?I don't know if this question was asked before,but I can't find it anywhere.

Steam ID: fancreeper
08-29-2013, 03:00 PM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#36
RE: Updating script support, taking requests

(08-29-2013, 03:00 PM)fancreeper Wrote: I have a little question.Is it possible to make outside levels,like in AAMFP,with the updated version of ATDD?I don't know if this question was asked before,but I can't find it anywhere.
you can do that in the current version sir
(that is given you have the right custom assets)
(This post was last modified: 08-29-2013, 03:11 PM by WALP.)
08-29-2013, 03:11 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#37
RE: Updating script support, taking requests

A few more suggestions, mainly regarding entities:
  • GetEntityFilename(entity) - Determine the name of the entity file for a given entity in the map
  • GetEntityJoints(entity) - return a list of all joint names in the entity
  • GetWheelAngle
  • GetLampLit
  • Get/Set #tinderboxes & thalers the player has
  • Built in method to compose rotations - E.g. float[] applyRotation(Ax,Ay,Az,Bx,By,Bz) - returns a rotation from the resultant transform of A followed by B. I suggest this as if SetRotation is exposed, it will save us from having to re-implement matrices (or quaternions) for rotation composition.
(This post was last modified: 08-29-2013, 07:46 PM by Apjjm.)
08-29-2013, 06:51 PM
Find
felixmole Offline
Senior Member

Posts: 482
Threads: 7
Joined: Dec 2012
Reputation: 10
#38
RE: Updating script support, taking requests

(08-29-2013, 08:44 AM)felixmole Wrote:
(08-27-2013, 12:29 PM)JustAnotherPlayer Wrote: Can you make the if-else function that the parameter could turn Integers to Bools and vice-versa?

This is inherent to the AngelScript language, use casts (even though it's bad) to overcome these errors.

In fact, AngelScript allows you to define implicit casts:

http://www.angelcode.com/angelscript/sdk...opbeh.html
08-29-2013, 08:02 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#39
RE: Updating script support, taking requests

I am against the integer to bool implicit conversion on the grounds of legible code. When the boolean type has been made available, it is best practice to use a boolean to represent a boolean value, rather than stick in some coercion to get around the fact that int isn't bool - especially when the language does not do this by default. Just use !=0 - it is far easier to see what is going on at a glance, and it's 3 extra characters.

See also:
http://msdn.microsoft.com/en-us/library/b6801kcy.aspx
http://stackoverflow.com/questions/55547...-integer-1
http://geosoft.no/development/cppstyle.html#Variables [Not the only standard obviously...]
(This post was last modified: 08-29-2013, 09:42 PM by Apjjm.)
08-29-2013, 08:52 PM
Find
felixmole Offline
Senior Member

Posts: 482
Threads: 7
Joined: Dec 2012
Reputation: 10
#40
RE: Updating script support, taking requests

I agree with this.
08-29-2013, 11:27 PM
Find




Users browsing this thread: 1 Guest(s)