Author Topic:  Bool  (Read 644 times)

0 Members and 1 Guest are viewing this topic.

Hayden

  • Elite Member
  • *****
  • Posts: 516
  • Obey no one, Respect everyone.
  • Awards 1 year on site+100 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts
    • View Profile
    • Awards
  • Xbox: mister m0nk3y
  • Steam: Hayden
  • Other: 123456789
Bool
« on: February 09, 2017, 01:15:00 AM »
For those who don't know what a bool is, It's basically marking something as true or false.
And what my Idea is, an addition to scripting which replaces the history binary method. which is where if you wanted something to equal true you'd change the history to 1, and if you want it to be false you'd mark it 0, But it'd be nice to have something like this:


SetBool [player|System] [name] [True|False]


this could be held in the historys folder or it's own separate Bools folder

example of how it could work 'off of my memory on scripts':

Name:Button\Level\One
_____

IfBool [HasCompleted\one] [true]
then
MessageBox [You've already done this, no credits will be earned] [[Continue][TeleportLevelOne]]
else
Notify [Get ready] [local]
Notify [Get set] [local]
teleport [player] [123,201,123]
Notify [GO] [local]
endif

----------------
Name:Zone\CompleteLevel\One
_____

IfBool [HasCompleted\one] [false]
SetBool [player] [HasCompleted\one] [true]
 // Give Cool Reward
EndIf

teleport [player] [321,201,321]



« Last Edit: February 09, 2017, 01:27:14 AM by Hayden »
Max characters: 300; characters remaining: 241

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4177
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Bool
« Reply #1 on: February 09, 2017, 08:53:15 AM »
Question. How is this any different from HasHistory [name] [player] [true|false] in a practical manner?

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

Jack Of Shades

  • Supreme Member
  • *****
  • Posts: 3216
  • Awards Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts Members who have unlocked the robotic avatar 1 year on site+100 posts Was in the top 10 of the forum stats page as of 4/12/15 Former MotM winners
    • View Profile
    • Awards
Re: Bool
« Reply #2 on: February 09, 2017, 10:23:32 AM »
True False anything on scripts is Boolean. That's precisely what it does. It determines if something is true or false. Just as Int verifies an integer variable, float declares a floating point variable (approximates a number basically) Double, and so on. Odd thing is, you'd have to provide a transition of sorts to turn an integer (int) into a Boolean output/input. Or so I've studied...thus far. lol Although, with J A V A it seemed more difficult. C#, not so much. For example converting an integer could be done 3 different ways: Convert.ToInt16, Convert.ToInt32, and Convert.ToInt64. Based off bit size, as you know. Same with Boolean, minus 2 ways. It's just: Convert.ToBoolean. Sorry to get off topic. Just noticed that. Correct me if I am wrong. Still getting the whole thing down. :P

I find this line kind of odd:
IfBool [HasCompleted\one] [true]
It's like two booleans in one. If this variable is true (boolean) then this boolean must be true. xD Again, still new to this but that's how it sounds to me.

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6497
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Bool
« Reply #3 on: February 09, 2017, 05:29:16 PM »
You can do this now:

history [name] // create history
history [name] [delete] // delete history

if
   hashistory [name]   // [true] is optional/default
then
   // we have the history

or

if
   hashistory [name] [false]
then
   // we don't have the history


So I don't see the need for separate bool support as the current syntax is basically identical.

Lunar

  • Elite Member
  • *****
  • Posts: 884
  • The God of the Galaxy
  • Awards 1 year on site+100 posts 2 years on site+300 posts
    • View Profile
    • Awards
  • Xbox: Qvzw
  • PSN: Widumn_Boise
Re: Bool
« Reply #4 on: February 09, 2017, 05:54:34 PM »
I think he wants bools as a local type thing, history is throughout all scripts, but you could just make something like..

var [bool] = [1]
// 1 being true

var [bool] =

// 0 being false

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6497
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Bool
« Reply #5 on: February 10, 2017, 12:33:00 AM »
I think he wants bools as a local type thing, history is throughout all scripts, but you could just make something like..var [bool] = [1]

Really?

an addition to scripting which replaces the history binary method. which is where if you wanted something to equal true you'd change the history to 1
this could be held in the historys folder or it's own separate Bools folder

No. Clearly the example in the OP requires history persistence.

Hayden

  • Elite Member
  • *****
  • Posts: 516
  • Obey no one, Respect everyone.
  • Awards 1 year on site+100 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts
    • View Profile
    • Awards
  • Xbox: mister m0nk3y
  • Steam: Hayden
  • Other: 123456789
Re: Bool
« Reply #6 on: February 10, 2017, 08:41:52 PM »
I want it to be global like histories, but for now, and possibly forever, we will have to survive off histories...
Max characters: 300; characters remaining: 241

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4177
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Bool
« Reply #7 on: February 10, 2017, 09:16:43 PM »
I want it to be global like histories, but for now, and possibly forever, we will have to survive off histories...

What do you mean survive? History does the exact same thing whilst allowing for even more function.

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

Lunar

  • Elite Member
  • *****
  • Posts: 884
  • The God of the Galaxy
  • Awards 1 year on site+100 posts 2 years on site+300 posts
    • View Profile
    • Awards
  • Xbox: Qvzw
  • PSN: Widumn_Boise
Re: Bool
« Reply #8 on: February 11, 2017, 12:11:12 PM »
Then Im confused, if he wants something global like history, whats the point of this, because hes asking for History but renamed, I really dont see the need.

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4177
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Bool
« Reply #9 on: February 11, 2017, 04:15:18 PM »
Here's an idea that may not be entirely useful but is worth mentioning.

What if you could set what kind of number a history value is stored as?

To do this idea, You could store a history as a single bit. You could also store history as a byte, A signed byte, 32bit signed integer, 32 bit unsigned integer, 64 bit signed integer, Or a 64 bit unsigned integer.


I am not entirely sure how useful this would be, But we have the [single:] option to vars which I doubt anyone is going to use in most cases.

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym