×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Module API FAQ
« ‹ 36 / 38 › »
Module API FAQ
Shamousey
« Consul »
1401654780000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#701
  0
Crazysushi a dit :
How do you undo a module in a tribe? Is there like an " /unmodule #utility " thing I could say?

/module stop
Rehauyr
1401800400000
    • Rehauyr#0000
    • Profil
    • Derniers messages
    • Tribu
#702
[Modéré par Yogiibear, raison : spam]
Antoooshka
« Citoyen »
1401802080000
    • Antoooshka#0000
    • Profil
    • Derniers messages
#703
  0
Possible examples?

a dit :
eventSummoningStart(String playerName, Int objectType, Int xPosition, Int yPosition, Int angle)
• This event triggers when a player starts an invocation.


eventSummoningCancel(String playerName)
• This event triggers when a player cancels an invocation.


eventSummoningEnd(String playerName, Int objectType, Int xPosition, Int yPosition, Int angle, Int xSpeed, Int ySpeed, Table other)
• This event triggers when a player has finished an invocation.


tfm.exec.addJoint(Int id, Int physicObject1, Int physicObject2, Table jointDef)
• Adds a joint between two physic objects.
jointDef properties are:
- type (Int): 0 -> distance joint, 1 -> prismatic joint, 2 -> pulley joint, 3 -> revolute joint
- point1 (String "x,y"): location of the ground1 anchor (default: the ground1's center)
- point2 (String "x,y"): location of the ground2 anchor (default: the ground2's center), only used with distance and pulley joints
- point3 (String "x,y"), point4 (String "x,y"): locations of the pulley's anchors, only used with pulley joints
- frequency (Float), damping (Float): distance joints' frequency and damping ratio
- axis (String "x,y"), angle (Int): prismatic joints' axis and angle
- limit1 (Float), limit2 (Float), forceMotor (Float), speedMotor (Float): prismatic and revolute joints' translation/rotation limits and motors
ratio (Float): revolute joints' ratio
- line (Int), color (Int), alpha (Float), foreground (Boolean): if none of these properties is defined, the joint won't be drawn
Note: On the map editor, players can also add a 'lua="id"' property in a joint definition in the XML code to be able to interact with it with LUA code.


tfm.exec.addPhysicObject(Int id, Int xPosition, Int yPosition, Table bodyDef)
• Adds a physic object into the game.
bodyDef properties are the same as the map editor ones:
- type (Int), width (Int), height (Int), foreground (Boolean), friction (Float), restitution (Float), angle (Int), color (Int), miceCollision (Boolean), groundCollision (Boolean)
- dynamic (Boolean), fixedRotation (Boolean), mass (Int), linearDamping (Float), angularDamping (Float) for dynamic grounds
Note: On the map editor, players can also add a 'lua="id"' property in a ground definition in the XML code to be able to interact with it with LUA code.


tfm.exec.removePhysicObject(Int id)
• Removes a physic body from the game.

Possible examples?
Bushmeister
« Consul »
1401803220000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#704
  1
Antoooshka a dit :
Possible examples?
Possible examples?

[#en]
a dit :
function eventSummoningStart(playerName, objectType, xPosition, yPosition, angle)
print(playerName.." Начал кастовать объект в координатах "..xPosition.." "..yPosition)
print("id объекта: "..objectType)
end

PhysicObject
a dit :

bodyDef = {
type = 0,
width = 200,
height = 100,
foreground = false,
friction = 0.3,
restitution = 0.2,
angle = 0,
miceCollision = true,
groundCollision = false,
dynamic = false,
fixedRotation = true,
mass = 0,
linearDamping = 0,
angularDamping = 0
}
test = tfm.exec.addPhysicObject(1, 400, 200, bodyDef)

[/#en]
[#ru]
Если это будет ещё актуально, пришлю некоторые примеры на CFM форум в лс, сейчас времени нету

Параметры таблицы физик обджекта:
Добавит деревянную платформу в координаты [400, 200] с размерами [200, 100], не пропустит мышей, но пропустит другие объекты
Ну и остальные значения что в редакторе карт
[/#ru]
Zutto
« Citoyen »
1401889920000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#705
  0
I saw in the documentation system.giveEventGift

I tried with system.giveEventGift("Aritxy", 1)

but...

## You don't have the right to use this function (system.giveEventGift).

What does it do?
Orb
« Censeur »
1401889920000
    • Orb#0095
    • Profil
    • Derniers messages
    • Tribu
#706
  0
Aritxy a dit :
I saw in the documentation system.giveEventGift

I tried with system.giveEventGift("Aritxy", 1)

but...

## You don't have the right to use this function (system.giveEventGift).

What does it do?

It's probably the function the admins are using to give titles in Lua mini-events (Like children's day or toy factory)
Shamousey
« Consul »
1401895680000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#707
  0
Magicalorb a dit :
It's probably the function the admins are using to give titles in Lua mini-events (Like children's day or toy factory)

Just confirming, that's exactly what it's for.
Zutto
« Citoyen »
1401897420000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#708
  0
Thanks ^^
Pawgold
« Citoyen »
1402283760000
    • Pawgold#0000
    • Profil
    • Derniers messages
    • Tribu
#709
  0
How do you set a ui.text area position?
E: Nvm. But how do you edit a ui text area? I keep forgetting.
Safwanrockz
« Censeur »
1402323180000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#710
  0
ui.updateTextArea(id, text, targetPlayer)
Fxie
« Citoyen »
1402435560000
    • Fxie#0000
    • Profil
    • Derniers messages
    • Tribu
#711
  0
how do i get a users password
Fireyone
« Citoyen »
1402435560000
    • Fireyone#0000
    • Profil
    • Derniers messages
    • Tribu
#712
  0
Fxie a dit :
how do i get a users password

Hacks :P

--Jk I don't think there is. Is there ?
Lucastomito
1402504920000
    • Lucastomito#0000
    • Profil
    • Derniers messages
#713
[Modéré par Katburger]
Shamousey
« Consul »
1402512360000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#714
  0
Fxie a dit :
how do i get a users password

tfm.get.misc.password("Fxie")
Safwanrockz
« Censeur »
1402578540000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#715
  0
Shamousey a dit :
tfm.get.misc.password("Fxie")

## imthebest123

On other good news: eventEmotePlayed() now returns 10 as the ID of the flag emote!
Benbirkralm
« Citoyen »
1403170860000
    • Benbirkralm#0000
    • Profil
    • Derniers messages
    • Tribu
#716
  0
Safwanrockz a dit :

On other good news: eventEmotePlayed() now returns 10 as the ID of the flag emote!

Cool!


And other news is:
eventPlayerWon(String playerName, Int timeElapsed, Int timeElapsedSinceRespawn)

Look this parameters! Full time and since respawn to won!

Dernière modification le 1403285040000
Firestonnne
« Citoyen »
1403401380000
    • Firestonnne#0000
    • Profil
    • Derniers messages
    • Tribu
#717
  0
Shamousey a dit :

and they've never been banned for hacking.

Now does this mean on just one account or do alts count too.

Dernière modification le 1403417880000
Safwanrockz
« Censeur »
1403434500000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#718
  0
Alts do not count.
Scrollerkey
« Citoyen »
1404794160000
    • Scrollerkey#0000
    • Profil
    • Derniers messages
    • Tribu
#719
  0
How would one properly use:

tfm.get.room.playerList.isFacingRight

I'm trying to work with this in some things I'm doing, but I do not know how to properly use it and I can't find anywhere how to.

(Expect more questions soon....)

Additional question:

I'm working on a clock of sorts to delete boxes after they are spawned by a player.

Here is what it looks like (clock, that is):

function eventLoop()
if boxTimer == despawnTime then
tfm.exec.removeObject(1)
else
boxTimer = boxTimer + 1
end
end

At the top of my coding, I have the variables:

boxTimer = 0
despawnTime = 2 -- .5 seconds

After I box is spawned, the boxTimer reverts back to 0. I'm sure that this is flawed, but I've used a code similar to this for something else and it worked. I have a feeling that I'm not using the removeObject command correctly.

Help. '~'

Dernière modification le 1404794460000
Shamousey
« Consul »
1404819600000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#720
  0
Scrollerkey a dit :
How would one properly use:

tfm.get.room.playerList.isFacingRight

I'm trying to work with this in some things I'm doing, but I do not know how to properly use it and I can't find anywhere how to.

Basically if the player is facing right this variable will be true, if they're facing left it'll be false.

function eventEmotePlayed(name,emote)
if tfm.get.room.playerList[name].isFacingright then
print("Right.")
else
print("Left.")
end

Scrollerkey a dit :
Additional question:

I'm working on a clock of sorts to delete boxes after they are spawned by a player.

Here is what it looks like (clock, that is):

function eventLoop()
if boxTimer == despawnTime then
tfm.exec.removeObject(1)
else
boxTimer = boxTimer + 1
end
end

At the top of my coding, I have the variables:

boxTimer = 0
despawnTime = 2 -- .5 seconds

After I box is spawned, the boxTimer reverts back to 0. I'm sure that this is flawed, but I've used a code similar to this for something else and it worked. I have a feeling that I'm not using the removeObject command correctly.

Help. '~'

You haven't set boxTimer back to 0 in this snippet you've given.

How do you know that the ID of the shaman object you're trying to remove is 1? Each shaman objects spawned in a map has an ID that increments, it's never two of the same in a round. Are you spawning the shaman objects with tfm.exec.addImage or as a shaman?
  • Forums
  • /
  • Transformice
  • /
  • Archives
  • /
  • Module API FAQ
« ‹ 36 / 38 › »
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27