JulienLaclaverie / PZ_DieTonightMap

A projet Zomboid Map & Mod inspired from the game Die2Night
0 stars 0 forks source link

[Mod] We can pass through gates after closing animation #9

Closed SylvainMarty closed 7 years ago

SylvainMarty commented 7 years ago

The gates don't become "hard" after the animation.

After leaving and entering a few times through the gate closed (after closing animation), the tiles retrieve their collision properties.

I don't know why this is happening...

SylvainMarty commented 7 years ago

After a few words with @JulienLaclaverie, I need to try to make IsoThumpable in replacement of IsoObject.

If this not work, find the best type for this object (zombies.iso packages).

SylvainMarty commented 7 years ago

blindcoder answer <3

did you set self.setCanPassThrough = false in your lua object? basically callyng fence:setCanPassThrough(false) should do it

I needed to hotfix buildUtil.setInfo for my craftec project a while back. you can see all the parameters for IsoThumpables there: https://github.com/blind-coder/pz-craftec/blob/master/media/lua/server/BuildingObjects/BCCrafTec.lua#L7

the complete way to create an object in the world is:


local cell = getWorld():getCell();
self.sq = cell:getGridSquare(x, y, z);

self.javaObject = IsoThumpable.new(cell, self.sq, "carpentry_02_56", north, self); buildUtil.setInfo(self.javaObject, self); self.javaObject:setBreakSound("breakdoor"); self.sq:AddSpecialObject(self.javaObject);

self.javaObject:transmitCompleteItemToServer();


ignore the self. if you're not inside a lua object

> though I recommend you look at the whole BCCraftTec.lua file linked above, it contains a lot of stuff tha will come in handy

> thouh the important functions are new, create and IIRC tryBuild is used somewhere, too. IIRC tryBuild is the equivalent to isValid for TimedActions