Author Topic:  Var Scripts  (Read 268 times)

0 Members and 1 Guest are viewing this topic.

aaronsbillwa

  • Jr. Member
  • **
  • Posts: 33
  • I've just joined the Fourms but playing since 1.75
    • View Profile
    • Awards
  • Xbox: aaronsbillwa
Var Scripts
« on: November 10, 2016, 10:54:39 PM »
Anyone that is good with var's can you help me. I was wondering how I can make a script that could draw from a history and not have to script every number in the world?
« Last Edit: November 11, 2016, 07:09:07 PM by aaronsbillwa »

AlienizdPixel

  • Tester
  • Supreme Member
  • *****
  • Posts: 2576
  • Hallo
  • Awards 3 years on site+600 posts Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: A1ienizdPixe1
  • Steam: Alienizd
Re: Var Scripts
« Reply #1 on: November 13, 2016, 08:20:48 AM »
Var [History:VarName]
Replace "History" with "SysHistory" to draw from the system history values ("History" is from the player), and "ClanHistory" to draw from a clan's history value
...and not have to script every number in the world?
I do not understand.
-Alionz

TheDestinedCrab

  • Legendary Member
  • *****
  • Posts: 1277
  • Did you see that? Me neither.
  • Awards 3 years on site+600 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • Awards
Re: Var Scripts
« Reply #2 on: November 13, 2016, 08:56:47 AM »
...and not have to script every number in the world?
I do not understand.

He means not have to do something like this, i believe :

If
IsVar [name] = [1]
Then
...
ElseIf
IsVar [name] = [2]
Then
...

And so on.
Thanks Gold Knight for the amazing sig!

crazytater94

  • Supreme Member
  • *****
  • Posts: 2556
  • Mastering TM since 2011
  • Awards Awarded to exemplary forum members Members who have unlocked the robotic avatar 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 Former MotM winners Week 1 members w/25+ posts (4/13/13-4/20/13) 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: crazytater94
  • PSN: crazytater94 (Inactive)
  • Steam: crazytater94
Re: Var Scripts
« Reply #3 on: November 13, 2016, 10:24:53 AM »
Think of VAR as a high school algebra equivalent of "X" where it's value can change and isn't a set number.

So, if Var + 2 = Var2, then that would be like x + 2 = y.

Here's an example:


Var [MaxHP] = 10
// (the max health points equals 10)
Var [HP] = [history:Lvl] + 2
// (the player's current HP count is whatever level they are, +2 (sets level 1 to 3 hearts))

If
IsVar [HP] > [MaxHp]
Then
Var [HP] = [MaxHp]
Else
// (do nothing)
Endif



What that does, is set your max HP to 10 and your HP cannot go above 10.

Note: This does not actually work, it's just an example for var.

Lunar

  • Elite Member
  • *****
  • Posts: 878
  • The God of the Galaxy
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: Qvzw
  • PSN: Widumn_Boise
Re: Var Scripts
« Reply #4 on: November 15, 2016, 10:19:06 PM »
Does anyone even understand the question? Cause I don't, but if I did I would love to help.