oen432
Legendary OT User
Another day, another project .
I'm not here to sell you this nor convince that this is something you should praise, just wanted to showcase what is on the way.
Node based editors are already a thing for years, the most famous being Blueprints from Unreal Engine 4 and Unity Bolt (you can create games without writing single line of code).
Lua is not as advanced as C++ or C# so it's not going to be that powerful either but that doesn't mean it won't be useful.
Will this be open-source? Yeah, of course. I just need time to make every functionality working so then I can rewrite entire code (well 80%) and make it open-source friendly.
This video is a showcase of building this simple NPC script.
This being my 1050th post and achieving reaction score 1000, that's 95.2% of my posts, incredible.
I'm not here to sell you this nor convince that this is something you should praise, just wanted to showcase what is on the way.
Node based editors are already a thing for years, the most famous being Blueprints from Unreal Engine 4 and Unity Bolt (you can create games without writing single line of code).
Lua is not as advanced as C++ or C# so it's not going to be that powerful either but that doesn't mean it won't be useful.
Will this be open-source? Yeah, of course. I just need time to make every functionality working so then I can rewrite entire code (well 80%) and make it open-source friendly.
This video is a showcase of building this simple NPC script.
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local requiredLevel = 150 -- declared in builder as "Required Level" number
local storageKey = 1234 -- declared in builder as "Storage Key" number
local bossName = "Demon" -- decalred in builder as "Boss Name" string
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function onMessageDefault(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
local player = Player(cid) -- get Player from creature id (cid)
if msg == "boss" then -- check if message is equal to "boss"
if player:getLevel() >= requiredLevel then -- check if player level is higher or equal than Required Level
if player:getStorageValue(storageKey) == -1 then -- check if player hasn't spawned boss before
Game.createMonster(bossName, Position(1000, 1000, 7)) -- spawn boss
player:setStorageValue(storageKey, 1) -- set storage value to 1
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onMessageDefault)
npcHandler:addModule(FocusModule:new())
This being my 1050th post and achieving reaction score 1000, that's 95.2% of my posts, incredible.
Last edited: