Jump to content

Razer

Member
  • Posts

    4
  • Joined

  • Last visited

Razer's Achievements

  1. Wow, I didn't know there's a method looks as magical as "getClassField()". This will be very handy if I can't find a more viable method but have to achieve something. Many thanks for your reply!
  2. I'm relatively new to PZ modding, and the kahlua tutorials or documents over the internet are quite rare. Let me ask this question: is it possible to access public attributes of public Java classes from lua scripts? I'm sure calling public methods is viable. But there are many public attributes that didn't come with get/set methods, and try accessing them directly causes trouble. For example, "print(obj.attribute)" will always output nil, and "obj.attribute = some value" would trigger errors, which read like the class of obj isn't exposed enough for you to access its attributes. Please tell me if there is a way to make this, really appreciate!
  3. • Version? • Singleplayer/Multiplayer? • Host or dedicated? • Mods? • Reproduction steps: • 41.65 • Multiplayer. • Dedicated. • Yes. • Reproduction steps: 1. Write a lua script or something that make player emit custom sound (Code example: soundID = getPlayer():playSound(soundName) ) 2. In the script in step 1, write a code to set volume and pitch for the sound id returned. (Code example: getPlayer():getEmitter():setPitch(soundID, 2) 3. Start a server, joined with 2 clients as 2 players. Get the 2 players together, so they can here sound emitted from each other. 4. Mute one of the clients as clientA, and make the clientA emit a sound by calling the script above. Then you should hear a sound with unchanged pitch and volume received by the other client as clientB. Similarly, unmute the clientA and mute clientB, emit sound from clientA again, then you should hear a sound set with intended pitch and volume. The conlusion could be that when playing a sound from one client, the instruction DOES pass through network to other clients, so all the clients can hear the sound. However, when setting the pitch and volume of the sound, they DO NOT pass to other clients. Therefore, the client which emits the sound can locally hear intended tuned sound, but clients from the othersides of the network only hear the original sound. Although this problem seems trivial, but I really hope the devs can look into it, thanks!
  4. I'm new to modding. I'm trying to get the specific player's IsoPlayer by the author name of a chat message. For now, the only way I think up is to compare the author name with all player's username. Is there better method? Edit: Seems like I was referencing old javadoc... There is actually getUserName() in the new version. By the way, I haven't got a idea how to create a sound on the world space with lua code. I'm figuring it out.
×
×
  • Create New...