Useful for an Rpg game, or if you want a player to have to be strong enough to do a quest or get a weapon etc.Lets say you are needing an Rpg style game, which you need to get levels when you kill a sentry, and the higher level you are, the easier they are to kill, or certain requirements need to be met (strong enough) to do a task (Note: If you do this each time it will take alot of memory, maybe make only 10% of enemies give xp, but when they do, they give a lot!
Step 1: Place down a sentry, and a trigger, wire the Sentry to the trigger so that when it is knocked out, it triggers. The trigger is not visible, and is not triggered by collision. Make the trigger’s block when triggered, and it’s code this!
Now, close the coding area. Now, you should do some for only a couple (1/3) sentries, but make them give alot of EXP
However, I did say this was a Level system, did I not? So Each level in the game will need 100 EXP to become a new level, (if you want to make the levels get harder each time, make the sentries farther in the game give less EXP)
Step 2: Place a Property and make it’s setting’s
Now make another property, call it “Level” It is a number property, it starts at 1 (or 0 if you want) it’s scope settings are player, leave the rest on default.
Step 3: Now place down a lifecycle, a repeater, and another trigger, make the trigger’s settings the same as the other’s (but different blocks) Wire the Lifecycle to the repeater, so that when the game starts it runs. Make the repeaters settings this.
It stops when receiving on a channel, and it runs every 0.5 seconds
Ok now, wire the repeater to the trigger, so that when it runs the task, the trigger triggers. Now make a block for the trigger, on when triggered. Here is the code:
(if you want to deny acsess to certain places if you are below ____ Level then all it takes is some block code!) Final step: Now, what is the use of a level if you don’t know that you just leveled up? just add a notification, make it say someting like “Level Up!” and make it show when it recieves on channel Level Up.
Optional
Optional: Do you want the player to know what level they are, or how close they are to leveling up, then use the same repeater, and add a game overlay, make the block code in the overlay on
when receiving on channel “LVL” add into the repeater to make it Broadcast on channel “LVL” then, here is the code:
That is it, you can also make a way so that it checks your level with some easy block code, but I will leave that to you!
Still here? Do you want players to get “stronger as they level up?” You can make some sentries activate that are weaker, but only when you are a certain level! SImply place a lifecycle, wire it to a new repeater that runs every 0.5 seconds. Event starts ------ start repeater. Make the repeater end while on a channel. Now place a trigger, that can not be triggered by collision and is not visible. Now place 3 sentries close to each other. Make one have 200 health (or whatever seems fit.) one can have 150 health, and maybe one can have 50-70 health.Now wire the repeater to the trigger, so when it runs the task, it triggers. Make the block code in the trigger this.
Make all 3 of the sentries NOT ACTIVE on the start. Make the Sentry with 200 health, only appear on channel strong, the one with 150 health appear on channel mid, and the final one on channel weak. They all should be wired to the trigger that gives EXP points. This one will have you use 3x sentries, but if you like little touches, and so that level have a purpose, this is for you, each one of the sentries don’t need another repeater and trigger, just the sentries! Ok, that’s the final edit!