• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 1.x] Tron Event [V0.5]

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,286
Location
Sweden?
giphy.gif


Hello, i always wanted to making a race event long time ago. But i had no coding skills todo it. Now several years later, i got the idea back into my head. But i thougt it was boring, then i remember i watched the movie 'Tron Legacy', so here we are a hour later :p

Todo
  • Add boost and jump command!
  • Hitting the wall, should kill you! [Now only player field kill you]
  • Clean up and optimize!

Add this into actions/actions.xml
Code:
<action actionid="8000" script="tronEventLever.lua" />

Create "tronEventLever.lua" inside actions/scripts and paste this:

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1945 then
        if tronEvent:onUseLever(player) == false then
            return true
        end
    end

    item:transform(item.itemid == 1945 and 1946 or 1945)
    return true
end

Now inside movements/movements.xml you need remove these lines:

Code:
    <movevent event="AddItem" itemid="1492" function="onAddField" />
    <movevent event="StepIn" itemid="1493" function="onStepInField" />
    <movevent event="StepIn" itemid="1500" function="onStepInField" />
    <movevent event="AddItem" itemid="1500" function="onAddField" />
    <movevent event="StepIn" itemid="1506" function="onStepInField" />
    <movevent event="AddItem" itemid="1506" function="onAddField" />

And add this instead:

Code:
    <movevent event="StepIn" itemid="1492" script="tronEventMovement.lua" />
    <movevent event="StepIn" itemid="1500" script="tronEventMovement.lua" />
    <movevent event="StepIn" itemid="1506" script="tronEventMovement.lua" />

Now create "tronEventMovement.lua" and inside movements/scripts and paste this:

Code:
function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if player == nil then
        return false
    end

    position:sendMagicEffect(CONST_ME_FIREAREA)
    tronEvent:onPlayerDeath(player, tonumber(item:getAttribute(ITEM_ATTRIBUTE_TEXT)) or 0)
    return true
end

Now in data/global.lua add this line:
Code:
dofile('data/tronEvent.lua')

Create new lua inside data folder and name it: "tronEvent.lua" and paste this:
http://pastebin.com/qdjptfYe
 
That's a funny one haha! Nice work! :p
 
If we hit 10 likes, i will finish it to version 1.0
 
Omfg this event is very similar to the game curvefever. Really nice work! ^^
It would be pretty close to the same if instead of having "!tron jump" the wagon didn't make fire every random amount of sqms :D
 
Do you guys have any suggestions. Before i finish the code :p
 
Frozen Starlights to make it bright and perty! Or use alternating flames around the arena xD

Oh and I'll be # 10 xD

EDIT: Oo! I know! Make the main floor invisible (nothing important) and put starlights under that on the lower floor ;) I guess that's user based then!
 
Very good, but the players are able to walk out of the event area and going to other map sites, already tried adding walls but to no avail
 
You cannot just add walls without coding the logic of the "crash" Ill will update it soon as possible.
 
Sir @Printer,
Any new about the "If we hit 10 likes, i will finish it to version 1.0"?

Thank you :)
Well it should not be hard thing todo, by yourself.

I would add walls around the arena and then fields infront of the walls.

As it now, i have no time to finish it.
 
Good stuff.

You can use Tile.getItemByType instead of looping through all items.
 
Good stuff.

You can use Tile.getItemByType instead of looping through all items.
Great idé, cheers! Will think about it next time :)
 
Back
Top