Jump to content

Water in an interior


Recommended Posts

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 ) 

Link to comment

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
Link to comment

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

Link to comment
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.

Link to comment

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.

Link to comment
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) 

Link to comment

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

Link to comment
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 ;)

Link to comment

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...