Jump to content

EDF and createObject Problem ><


h1ama3d

Recommended Posts

Hello,

I making script,

It works, but I have only one problem,

What script? :

Script that I work, you can make a road from vgncarshade1

You can choose the pieces, and the distance between each piece,

I have made the script for editor :cry:

This is the code:

Removed

This is the EDF file:

Removed

But when I am Typing '/c' to make the road

This is what is happening:(

This is the EDF Element

fL100715.jpg

http://store2.up-00.com/Mar11/fL100715.jpg

This is the Road,

8QM00715.jpg

http://store2.up-00.com/Mar11/8QM00715.jpg

Under water! :cry:

why ?

pls help me :cry:

sorry For my Bad English :(

and sorry i'am noob :(

Edited by Guest
Link to comment

stolen ?!

I made ​​this script

If you want to make sure, search for it, you will not find: @

I hate steal: @

Line No. 20 I took him from ggloop only!!

The rest that I made​​: @

If you do not want to help me, why comment?

and if i put comma

:20:Bad argument @ 'call'

Link to comment
  • Moderators

I think he means this:

call(getResourceFromName("editor"),"import",thisResource) 

You making a very hard script, you are a noob, and you forgot the () at getResourceFromName ? that's strange :|

At line 20: why getElementsByType ? It's not getElementsByName ?

Maybe there is a bad setElementData( ..., "posZ" ) for the first Carshade ?

Link to comment

try to check all elements of date and in general all over outputChatBox

  
local thisResource = getThisResource() 
local thisResourceRoot = getResourceRootElement(thisResource) 
function create (cmd,thePlayer) 
     carsh = getElementsByType ( "Carshade" )  
    for theKey,ca in ipairs(carsh) do  
        x = getElementData(ca, "posX")  
        y = getElementData(ca, "posY") 
        z = getElementData(ca, "posZ") 
        p = getElementData(ca, "pieces")  
        yy = getElementData(ca, "between")  
        outputChatBox("Check Elements:  "..tostring(x).." , "..tostring(y).. " , "..tostring(z).." , "..tostring(p).." , "..tostring(yy).." , "..tostring(carsh))  -- Check Elements 
        for i=0,p do 
            y = y + yy 
            vcs1 = createObject(3458, x, y, z) 
            setElementData(vcs1, "posX", x or 0) 
            setElementData(vcs1, "posY", y or 0) 
            setElementData(vcs1, "posZ", z or 0) 
        end 
    end 
    call(getResourceFromName("editor"),"import",thisResource) 
    destroyElement(thisResourceRoot) 
end 
addCommandHandler ( "c", create ) 
  

Link to comment

Check Elements: 3349.6772460938 , -1925.2801513672 , -2.3275413513184 , 20 , 5 , table: 02A49C28

x = 3309.162109375

y = -2029.51171875

z = -18.611539840698

----------------------------------------------------------

I think he means this:
call(getResourceFromName("editor"),"import",thisResource) 

You making a very hard script, you are a noob, and you forgot the () at getResourceFromName ? that's strange :|

At line 20: why getElementsByType ? It's not getElementsByName ?

Maybe there is a bad setElementData( ..., "posZ" ) for the first Carshade ?

very hard script yeah ,, i'am noob yeah ,, but i make it ! ,,

i put() but it's Does not work also ! :(

-----------

i don't understand what you mean >< sorry ,, in line 20 i put

call(getResourceFromName("editor"),"import",thisResource) 

not getElementsByType()

Link to comment
try instead of 0 put another number
  
 setElementData(vcs1, "posZ", z or 0)  
  

maybe it will help, I honestly do not know

ok ,, i change it to

setElementData(vcs1, "posZ", z or 100) 

and now over the EDF element xD

I will try to make it tight EDF Element

Sorry I wanted to say line 5 instead of 20

I have tried it, and I change it to

carsh = getElementsByName ( "Carshade" ) 

but

:5: attempt to call global 'getElementsByName' (a nil value)

:cry:

Can you help me pls ? Or will lose hope: ( :cry:

Link to comment

Firstly, getElementsByName doesn't exist.

Replace it again as you did in your first post with getElementsByType.

Also it's weird that you didn't understood why it's a nil value... you could search easily for that function and you could see that it doesn't exist, so you seem very suspicious.

There's an error with creating the objects in specified area, it's not error with the object.

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