Jump to content

Water in an interior


Recommended Posts

Posted

I'm trying to add water in an custom interior (it is in an own .map file), but I'm just getting bad argument at setElementDimenstion/Interior.

Script is short, tried to add it as a function and so on already.

local young = createWater( 267.58340454102, 101.59375, 1026.5515136719, 247.81484985352, 101.0810546875, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828, 266.61758422852, 111.638671875, 1026.5515136719 ) 
  
setElementInterior( young, 6 ) 
setElementDimension( young, 9 ) 

Posted (edited)

where function,handlers?

function waterInt() 
  
local young = createWater( 267.58340454102, 101.59375, 1026.5515136719, 247.81484985352, 101.0810546875, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828, 266.61758422852, 111.638671875, 1026.5515136719 ) 
  
setElementInterior( young, 6 ) 
setElementDimension( young, 9 ) 
  
end 
addEventHandler("onResourceStart",getRootElement(),waterInt) 

it has to be .lua file cause you can't add "function" to .map file

Edited by Guest
Posted

Water will be invisible at interiors unluckily.

But there's some object that looks like water, and you can "try" to make it look like it were real water.

But actually, there's no way to have visible water. Only invisbile. You would be swimming like if you were flying

Posted
Water will be invisible at interiors unluckily.

But there's some object that looks like water, and you can "try" to make it look like it were real water.

But actually, there's no way to have visible water. Only invisbile. You would be swimming like if you were flying

if it's true I think that make water is possible but you have to write it.

Here is my idea( I don't think that is good ):

1. make object like water

2. set it non collidable

3. make function if player will be under object then create dx effect or show blue transparent image.( underwater visual effect)

4. make player fly if he is under that object.

Posted

A: Nop, todd. No water, not visible, not invisible.

Getting:

[2012-04-04 22:19:24] WARNING: [rp]\map-system\custom\young.lua:3: Bad argument @ 'setElementInterior' 
[2012-04-04 22:19:24] WARNING: [rp]\map-system\custom\young.lua:4: Bad argument @ 'setElementDimension' 

still.

B: The visibillity is no problem, but I am not even getting invisible. I will spawn the water object later.

C: Wrote this before Todd's last post: I am not such a good scripter.

Posted
addEventHandler("onResourceStart",getRootElement(),function() 
local young = createWater( 267.58340454102, 101.59375, 1026.5515136719, 247.81484985352, 101.0810546875, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828, 266.61758422852, 111.638671875, 1026.5515136719 ) 
  
if young then 
setElementInterior( young, 6 ) 
setElementDimension( young, 9 )  
else 
outputChatBox("error at creating water", 255, 255, 255, true)  
 end 
end) 

Posted

Nop Renkon :/

Getting your nice little error.

Possibly something wrong with the MTA's water function, or?

I have tried .map tags to make it too.

Posted

Then it means that "young" object isn't created correctly. We are going straight to fix the problem.

Try this:

  
addEventHandler("onResourceStart",getRootElement(),function() 
local young = createWater( 247.81484985352, 101.0810546875, 1026.5515136719, 267.58340454102, 101.59375, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828,  266.61758422852, 111.638671875, 1026.5515136719 ) 
  
if young then 
setElementInterior( young, 6 ) 
setElementDimension( young, 9 ) 
else 
outputChatBox("error at creating water", 255, 255, 255, true) 
 end 
end) 
  

Tell me whether it works or not again. Thanks

Posted
Finally a place to swim! :D

Ty

No Problem

Remember that do make a Water quadrant you have to add, first, SW, then SE, then NW and finally NE by coordinates. That's why it wasn't working.

Posted
where function,handlers?
function waterInt() 
  
local young = createWater( 267.58340454102, 101.59375, 1026.5515136719, 247.81484985352, 101.0810546875, 1026.5515136719, 247.84414672852, 111.6982421875, 1026.5440673828, 266.61758422852, 111.638671875, 1026.5515136719 ) 
  
setElementInterior( young, 6 ) 
setElementDimension( young, 9 ) 
  
end 
addEventHandler("onResourceStart",getRootElement(),waterInt) 

it has to be .lua file cause you can't add "function" to .map file

Functions and handlers aren't needed, all things out of functions are executed when resource starts ;)

Posted
Finally a place to swim! :D

Ty

No Problem

Remember that do make a Water quadrant you have to add, first, SW, then SE, then NW and finally NE by coordinates. That's why it wasn't working.

Okay, the wiki should be a bit more clear on that then.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...