Alchemist awakening коды

Обновлено: 30.06.2024


Недостаточно оценок Scripting commands От Osaris Games

This guide will help you script your custom blocks, items, weapons and powers.

[Work in progress, please check back later]

В избранное В избранном Этот предмет добавлен в избранное.


Osaris Games
В сети 14 июн. 2016 в 7:54 9 авг. 2016 в 8:33
441 уникальных посетителей
9 добавили в избранное
Оглавление руководства



Introduction


Variables and members


Script syntax



Комментарии Introduction

Alchemist's Awakening comes with a powerful scripting language similar to Lua which lets you create really unique custom items and weapons and share then in the Steam Workshop.

  • OnCreated: called when the entity is first created.
  • OnUpdate: called at every frame is the entity is loaded.
  • OnUpdate: called at every frame is the entity is loaded.
  • OnClick: called when a player uses the Right click on an entity.
  • OnLeftClick: called when a player uses the Right click on an entity.
  • OnClickRelease: called when the use use the Right click on an entity.
  • OnLeftClickRelease: called when the use use the Right click on an entity.
  • OnMenuClose: called when a menu was opened (for example, to ask the user something) and closed.
  • OnCollide: called when a player or another entity is colliding the entity.
Variables and members

There are two types of variable: &variable will be a world global variable, which value is shared between all entities, and $variable will be an entity local variable, accessible only within one instance of an entity (but shared between all its different functions and states).

Variables can contain numbers, string, or entities. When you want to assign entities or string, please specify the type:
Example:
$i = 1
&j = $i
entity $entity = this.owner
string &text = "Hello, world"

  • &timestamp contains the number of seconds since the world was created
  • &time contains the time in hour (0 to 24), for example 6.5 represent 6h30 AM
  • &deltatime contains the elapsed time, in second, since the last frame (arount 0.016 s at 60 FPS)
  • &name
  • &gamemode will be 0 is the world is in Survival or 1 for Creative mode
  • &type
  • &seed the random seed of the world
  • &details
  • &generator flat world or normal
  • &sealevel
  • &spawnx
  • &spawny spawn postition of every player
  • &spawnz
  • &monsters
  • &weather
  • &timespeed
  • $name contains the name of the entity
  • $timeLived contains the age in seconds
  • $realDeltaTime contains the time since the last update of the entity. It can be useful because entities are not updated when they are in a chunk which is not loaded, so you need to use $realDeltaTime to know for how much time the entity has not been updated.
  • $birthDate contains the birthDate in seconds relative to the creation of the world.
Entity members

Members are similar to local variables, but they can be accessed from another entity.
For example:
$variable = target.gamemode
owner.x = owner.x + &deltatime * 5

  • x
  • y contains the current position of the entity
  • z
  • speedx
  • speedy contains the current speed of the entity
  • speedz
  • dirx
  • diry contains the current looking direction of the entity
  • dirz
  • accx
  • accy contains the current acceleration of the entity
  • accz
  • anglex
  • angley
  • life contains the current life percent of the entity
  • gamemode will be 0 is the entity is in Survival or 1 for Creative mode
  • xp
  • score
  • armor reduces damages taken
  • blockx
  • blocky target block position (set by the raycast command)
  • blockz
  • targetx
  • targety target position
  • targetz
  • type 1: Player, 2: Other player, 3: Mob, 4: Attack, 5:Custom creature, 6:Weapon, 7:Item
  • typeid subtype id
  • name current name
Script syntax

You can create functions using this syntax:
function name
.
end

You'll then be able to call a function using:
call name
from any of the listeners commands of this entity (not necessarily the same listener).
or timer name time to wait time before calling it (note: only one timer can be set for each entity. Calling timer again with another function before time will cancel the first timer.)

Functions are also really useful when you create a choice:
choice reset
choice "Do it!" call onefunction
choice "Cancel" default
choice show

Another important syntax is the If statement.
if condition then
.
end

if condition then
.
else if condition then
.
else
.
end

Conditions can be combined using && (and), || (or).
For example:
if target!=null && target.type==3 && target.typeid==golem then
attack fireball 1
end

[THIS SECTION IS WORK IN PROGRESS]

acquireTarget [Launching entity] <radius> [angle]
acquireTarget this 5

  • fireball: 0
  • lightning: 1
  • wind: 2
  • wolf_attack: 3
  • reindeer_attack: 4
  • thief_attack: 5
  • lion_attack: 6
  • stone_tempest: 8
  • punch: 8
  • flames: 10
  • sword: 11
  • golem_attack: 12

setstate <otherState>
setState default

call <function>
call myfunction

timer <function> <time>
timer myfunction 3

display <text> time x y zoom align size r g b a background
display "Bomb has been planted!" 3 0.5 0.5 2 center 0.5 1.0 0 0 0.8 1.0 0.5 0.2 1.0

spawnBlock x y z wood 10
Here are the accepted block types:

smooth_stone stone irregular cube block wood wood_large wood_small wood_medium column column_medium column_large column_small column_very_small slab slope middle_slab wood_very_small empty undef entity stairs glass glass_slab glass_slope glass leaf grass dry_grass flower flower1 flower2

spawnMob wolf this.x+10 this.y this.z this random(360)
spawnmob golem this.x+3 this.y this.z-random(20)
spawnentity 9_oven this.x+10 this.y this.z-random(20)
breakBlock other.x other.y other.z
spawnSchematic arbre3 this.x-10 this.y this.z-random(20)

choice reset
choice addChoice "Go to default state" default
choice addChoice "Call a function" call function name
choice show



Alchemist's Awakening

Alchemist's Awakening

Alchemist's Awakening > Общие обсуждения > Подробности темы 19 июн. 2019 в 16:11 missing orb i went to Mount Elhornih and after defeating the knights got the orb, went back to my house and had six orbs. Put some potions in my chest and when I went into inventory two of the orbs are gone, including the one from Mount Elhornih. [Разработчик] 20 июн. 2019 в 0:26

I'll investigate this issue, I'm not sure what caused it yet.

Anyway, if you have a missing orb it's always possible to find a new one of the same type in another place.

20 июн. 2019 в 3:48 12 сен. 2019 в 15:57 Did you ever find anything out about this issue? I put orbs in my chest at my home base. I have no idea when they disappeared, but I went to my chest to pull them out and take them to their altars and they were all gone. Zero orbs in my chest. I know I've collected and stored at least three. [Разработчик] 12 сен. 2019 в 16:38

No sorry, I still can't reproduce this problem. When the orbs disappear, does the chest still contains other items than orbs or is it totally empty?

17 сен. 2019 в 20:25

I have the same Problem with the Fire Orb, you can´t take this Orb, so i was on this Vulkan, killed all enenmys, taken this orb and after that vanished.

I cnt find another Vulkan spot. There is no other Altar arround, where to find the Fire Orb?
It looks like a Bug, the best trick was standing direct beside the Altar, quit, quit complete load Orb there, but the same like before, you cant take this orb vanished after taken.

And yes Validate Game cache was done.

I doesnt have this chest problem my orb are all inside. But the Fire orbs looks like bugy.

[Разработчик] 18 сен. 2019 в 6:27

I have the same Problem with the Fire Orb, you can´t take this Orb, so i was on this Vulkan, killed all enenmys, taken this orb and after that vanished.

I cnt find another Vulkan spot. There is no other Altar arround, where to find the Fire Orb?
It looks like a Bug, the best trick was standing direct beside the Altar, quit, quit complete load Orb there, but the same like before, you cant take this orb vanished after taken.

And yes Validate Game cache was done.

I doesnt have this chest problem my orb are all inside. But the Fire orbs looks like bugy.

This could be due to your inventory being full when you first try to take the Orb, I'm going to try to fix this.
The FIre orb can also be found in a Iron Forge or a Dark Temple, ask around in villages to find such places.

Читайте также: