shadowscion / Prop2Mesh

Garry's Mod Addon - Convert a group of props into a single clientside mesh
14 stars 8 forks source link

Can't use the P2m E2 library #14

Closed mbqwertyaaa closed 3 years ago

mbqwertyaaa commented 3 years ago

This is the E2 I'm using to test:

@inputs P2m:entity On  
@outputs  
@persist  
@trigger  
if(~On&On){
#P2m=p2mCreate(entity():pos()+vec(10,0,0),entity():angles(),1,1)
P2m:p2mSetPos(entity():pos()+vec(10,0,0))
P2m:p2mSetAng(entity():angles())
P2m:p2mPushModel("models/led2.mdl",entity():toLocal(vec(30,0,0)),entity():toLocal(ang(0)),vec(1))
P2m:p2mBuild()
P2m:p2mSetParent(entity())
P2m:p2mSetColor(vec(255,50,50))
P2m:p2mSetMaterial("models/proppertextures/acrylic")
}

It throws this error:

sv: Expression 2 (P2m Test): entities/gmod_wire_expression2/core/custom/prop2mesh.lua:313: attempt to get
length of field 'E2P2MResevoir' (a nil value)

This is the lua function, line 311-313 Here

if not Check_Parents(this, target) then
        return
    end

At one point during my experimenting today I did get it to work wiring a p2m entity and pushing models to that. I don't know what I did to make that controller work, but any others I spawned using the tool would only give the error previously stated.
I also can't get the E2 generated controller to receive or build. If I'm just not doing something right, please let me know.

Other than this problem, this is a great addon! Thanks for your work so far!

shadowscion commented 3 years ago

Vanilla wiremod? Not really seeing any changes that would have caused this

And wiring a physical controller to it shouldn't even work, at least with the push/build functions

mbqwertyaaa commented 3 years ago

Good to know. Would it be possible to let an E2 push to a physical controller? I made a christmas light E2 and it would be really cool to make it generate the p2m of itself automatically, and then the e2 can be deleted after the p2m. I almost have this implemented, but it breaks at the p2m part.