Author Topic: V.4 Variables help  (Read 1374 times)

I'm making an rpg,And theres some things i want to know.Would be nice if someone would help.

1.
I would like to know how to make a system that can increase your health (I'm trying to get it so that armor with increase your HP.)Or if theres a way i can actually make armor reduce damage,Either way i wanna know.

2.
I kinda want to know how i can make ores,blocks etc have HP.
Not much to explain here,But ive seen alot made like that.

3.
I would like to know how i can make a item that requires you to have more then 1 items (Etc,Hook+Rope,Bent stick+String..)


Second step, learn to script.
Events are extremely limited in what you can do, and gamemodes that make use of this extremely limited system are often boring and featureless, often with gameplay involving little more than click spamming on bricks.

I'm pretty sure #1 isn't possible with VCE (correct me if I'm wrong because I'm not an expert on VCE)

Second step, learn to script.
Events are extremely limited in what you can do, and gamemodes that make use of this extremely limited system are often boring and featureless, often with gameplay involving little more than click spamming on bricks.

I'm pretty sure #1 isn't possible with VCE (correct me if I'm wrong because I'm not an expert on VCE)
#1 isn't impossible with VCE, but it does take a little effort to set up.

I'm making an rpg,And theres some things i want to know.Would be nice if someone would help.

1.
I would like to know how to make a system that can increase your health (I'm trying to get it so that armor with increase your HP.)Or if theres a way i can actually make armor reduce damage,Either way i wanna know.

I made an add-on that includes amour type players, speed rank players, jump height ranks, and fist ranks/levels.
http://forum.blockland.us/index.php?topic=163072.0


2.
I kinda want to know how i can make ores,blocks etc have HP.
Not much to explain here,But ive seen alot made like that.

When the block is activated make the brick check for a variable called "hits" >= 10 (or any number)
Then on var tru, client add iron, message "got iron", brick disappear, then make sure to revert the "hits" var to 0 after the var is true.


3.
I would like to know how i can make a item that requires you to have more then 1 items (Etc,Hook+Rope,Bent stick+String..)

Make a var that adds to the player when they collect items. If they reach the correct amount, then use the events to "craft" that item. You can also use separate var names (recommended)

Variable Conditional Events (VCE) is basically your answer. V4 isn't as advanced as the current version.

First step, get VCE.

http://forum.blockland.us/index.php?topic=74148.0
I got v.4 variables so i could atleast do something,VCE is exteremly hard to figure out.


I'm talking about V.4 variables,Not Variable conditional events.


What is v4 variables?
The old version of variables.
Example:
Quote
Cake is 0
Frogs is 5

I got v.4 variables so i could atleast do something,VCE is exteremly hard to figure out.

I already answered how to do this.
You will need to listen to Oblivion and get the current VCE.
You cannot string with v4 vars, so using it is basically pointless.


I also wrote a guide (unfinished but thorough)

It doesn't really talk about stringing and stuff, it's more for like VCE beginners, but it may help you

http://brickmania.findtalk.net/t474-blockland-vce-in-depth-guide

It has good visuals

I'm making an rpg,And theres some things i want to know.Would be nice if someone would help.

1.
I would like to know how to make a system that can increase your health (I'm trying to get it so that armor with increase your HP.)Or if theres a way i can actually make armor reduce damage,Either way i wanna know.

2.
I kinda want to know how i can make ores,blocks etc have HP.
Not much to explain here,But ive seen alot made like that.

3.
I would like to know how i can make a item that requires you to have more then 1 items (Etc,Hook+Rope,Bent stick+String..)

First off, get the lastest version of VCE. What you're asking is impossible without VCE v7 and up.

Here's the events you need:

1)
Code: [Select]
[X] 0 [0] onActivate -> Self -> VCE_stateFunction -> [<var:cl:bl_id>] [ ]
[X] 1 [0] onActivate -> Self -> VCE_callFunction -> [<var:cl:bl_id>] [ ]
[X] 2 [33] onVariableFunction -> Self -> VCE_callFunction -> [<var:cl:bl_id>] [ ]
[X] 4 [0] onActivate -> Player -> VCE_modVariable -> [MaxShield] Set [100]
[X] 3 [0] onActivate -> Player -> VCE_modVariable -> [Shield] Set [<var:pl:maxShield>]
[X] 5 [0] onActivate -> Client -> CenterPrint -> [<color:FFFF00>You have picked up body armor!] [3]
[X] 6 [0] onVariableFunction -> Self -> VCE_ifValue -> [<var:pl:health>] < [<var:pl:maxHealth>] [7 7]
[X] 7 [0] onVariableTrue -> Self -> VCE_ifValue -> [<var:pl:shield>] > [0] [8 9]
[X] 8 [0] onVariableTrue -> Player -> AddHealth -> [1]
[X] 9 [0] onVariableTrue -> Player -> VCE_modVariable -> [Shield] Subtract [1]
[X] 10 [0] onVariableFunction -> Self -> VCE_ifValue -> [<var:pl:shield>] < [0] [11 12]
[X] 11 [0] onVariableTrue -> Player -> VCE_modVariable -> [Shield] Set [0]
[X] 12 [0] onVariableFalse -> Self -> VCE_ifValue -> [<var:pl:shield>] > [<var:pl:maxShield>] [13 13]
[X] 13 [0] onVariableTrue -> Player -> VCE_modVariable -> [Shield] Set [<var:pl:maxShield>]
[X] 14 [0] onVariableFunction -> Player -> VCE_modVariable [HP] Set [<color:66FF66><var:pl:health>]
[X] 15 [0] onVariableFunction -> Player -> VCE_modVariable [HP] Ceil [ ]
[X] 16 [0] onVariableFunction -> Player -> VCE_modVariable [SHLD] Set [<color:66FFFF><var:pl:shield>]
[X] 17 [0] onVariableFunction -> Player -> VCE_modVariable [ALL] Set [<var:pl:HP> <color:FFFFFF>/ <var:pl:SHLD>]
[X] 18 [33] onVariableFunction -> Client -> BottomPrint -> [<color:FFFF00>Health<color:FFFFFF>: <var:pl:ALL>] [3]

The last five events are for the display. You can toggle these off if you don't want it.

You can also change the MaxShield player variable to any number you want. You may also use other bricks that recover your shield. It will not exceed the MaxShield variable.



2)
This can range between tons of different scenarios, so I'll give you a generic one.

Code: [Select]
[X] 0 [0] onActivate -> Self -> VCE_modVariable -> Brick [MaxHits] Set [25]
[X] 1 [0] onActivate -> Self -> VCE_modVariable -> Brick [Resource] Set [Iron]
[X] 2 [0] onActivate -> Self -> VCE_modVariable -> Brick [ResourceType] Set [Ore]
[X] 3 [0] onActivate -> Self -> VCE_modVariable -> Brick [Amount] Set [1]
[X] 4 [0] onActivate -> Self -> VCE_modVariable -> Brick [RequiredItem] Set [ ]
[X] 5 [0] onActivate -> Self -> VCE_modVariable -> Brick [RespawnTime] Set [15]
[X] 6 [0] onActivate -> Self -> VCE_ifValue -> [<var:br:requiredItem>] == [ ] [8 12]
[X] 7 [0] onProjectileHit -> Self -> VCE_ifValue -> [<var:pl:currentItem>] == [<var:br:requiredItem>] [8 14]
[X] 8 [0] onVariableTrue -> Player -> VCE_modVariable -> [DisplayName] Set [<color:FF00FF><var:br:resource> <var:br:resourceType> <var:br:datablock><color:FFFFFF>:]
[X] 9 [0] onVariableTrue -> Player -> VCE_modVariable -> [DisplayHits] Set [<var:br:hits> / <var:br:maxHits>]
[X] 10 [33] onVariableTrue -> Client -> CenterPrint -> [<var:pl:displayName> <var:pl:displayHits>]
[X] 11 [0] onVariableTrue -> Player -> VCE_modVariable -> [VariableName] Set [<color:FFFF00><var:br:resource> <var:br:resourceType><color:FFFFFF>:]
[X] 12 [0] onVariableTrue -> Player -> VCE_modVariable -> [ResourceAmount] Set [<var:pl:VCE_<var:br:resource<var:br:resourceType>>]
[X] 13 [33] onVariableTrue -> Client -> BottomPrint -> [<var:pl:variableName> <var:pl:resourceAmount>]
[X] 14 [0] onVariableTrue -> Self -> VCE_ifValue -> [<var:br:hits>] < [<var:br:maxHits>] [15 23]
[X] 15 [0] onVariableFalse -> Client -> CenterPrint -> [<color:FFFFFF>Please use the proper tool to harvest this resource] [3]
[X] 16 [0] onVariableTrue -> Self -> VCE_modVariable -> Brick [Hits] Subtract [1]
[X] 17 [0] onVariableFalse -> Client -> VCE_modVariable -> [VCE_<var:br:resource<var:br:resourceType>>] Add [<var:br:amount>]
[X] 18 [0] onVariableFalse -> Self -> VCE_saveVariable -> Client [VCE_<var:br:resource<var:br:resourceType>>]
[X] 19 [0] onVariableFalse -> Self -> VCE_modVariable -> Brick [Hits] Set [<var:br:maxHits>]
[X] 20 [0] onVariableFalse -> Self -> VCE_stateFunction -> [Respawn] [ ]
[X] 21 [1000] onVariableFalse -> Self -> VCE_callFunction -> [Respawn] [ ]
[X] 22 [0] onVariableFalse -> Self -> VCE_modVariable -> Brick [R] set [0]
[X] 23 [0] onVariableFalse -> Self -> disappear -> [-1]
[X] 24 [0] onVariableFunction -> Self -> VCE_ifValue -> [<var:br:R>] >= [<var:br:respawnTime>] [25 27]
[X] 25 [0] onVariableFalse -> Self -> VCE_modVariable -> Brick [R] add [1]
[X] 26 [1000] onVariableFalse -> Self -> VCE_callFunction -> [Respawn]
[X] 27 [0] onVariableTrue -> Self -> disappear -> [0]

The first 6 variable are what you should change:
MaxHits: The number of hits the brick takes to harvest
Resource: What resource the brick is (Iron, Silver, Gold, Diamond, Maple, Oak, etc.)
Resource Type: What the resource type is (Ore, Wood, Fish, etc.)
Amount: How much the resource produces (1, 2, 3, 4...)
RequiredItem: The UI Name of the item required to harvest this resource (Pickaxe, Axe, Shovel, etc. Leave blank for bare hands.)
RespawnTime: How long the brick takes until it respawns (In seconds [1, 2, 3, 4...])



3) I'm not quite sure what you're asking here. This is borderline VCE, meaning some things will only be achievable via script. Depending on what you want, I may be able to provide you the VCE events that you require.

Anyways, all of things should theoretically work. I hope this helps.

First off, get the lastest version of VCE. What you're asking is impossible without VCE v7 and up.
actualy, it is possible with v4
just easier with v5+