Guest Posted September 9, 2003 Hi I,am working on a castle pack for ofp With towers, walls, gatehouse and much more. Everything is going nicely, but i need to make chains or rope going from the drawbridge into the gatehouse and on to a windlas. So it looks like the chains are lifting lowering the drawbridge. But i have no idea how to make the chains be longer when drawbridge going down and shorter when going up. This is much like the refuling hoses on Hawk's C-130, theyre to long to hide in the wings when retracted. Anyone knows how he made them? Hes work is binarized so i cand open it and see how he did it. Plz help me if you know the ansver to this one. Thanx:) Share this post Link to post Share on other sites
Footmunch 0 Posted September 9, 2003 One way to do it is to break up each, say, metre of chain into a separate selection. Then, when you want to shorten the chain, you can setobjecttexture[i, ""] each section so that it "disappears". When the chain starts getting longer, just re-texture each section in turn, and it will re-appear. You probably want to hide the re-texturing inside the wheel house walls so that the chain doesn't "pop" out of nowhere. Share this post Link to post Share on other sites
Guest Posted September 9, 2003 This sounds interesting, but i'am a noob when it comes to modding, i joust started to learn 1 month ago. So if you can explain a bit more detailed how to setobjecttexture[i, ""] (where you do this) and how to do this in general it would be nice. I have 1 meter thick walls to hide the retexture in. Share this post Link to post Share on other sites
scousejedi 0 Posted September 9, 2003 Col Klink has done an animation tutorial and has some info about setObjectTexture as well. http://www.dc3d.co.nz/tutorials/index.htm Its something you do in the config rather than the model. Try brsseb's tutorial #9 http://www.ofp.info/brsseb Share this post Link to post Share on other sites
Footmunch 0 Posted September 10, 2003 Well, if you have a 5m chain in O2 split into 5x1m lengths named: metre1, metre2, metre3, metre4, metre5 Then in the config.cpp for the castle, you'll have to have <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class CfgModels {   ...   class MyCastle   {     selections = {metre1, metre2, metre3, metre4, metre5};   }; }; class CfgVehicles {   ...   class MyCastle : Fortress1   {      hiddenselections = {metre1, metre2, metre3, metre4, metre5};      ...   }; }; This makes sure that OFP recognises that you have some newly defined bits (called metreN) in this model. Then, if you have an sqs (scripting file) called setlength.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ; Get the castle we're playing with _castle = this select 0 ; And the chain length we want _length = this select 1 ; Draw as much chain as we want _counter = 5 #DrawLoop ; Chose whether to draw or not ? (_counter > _length) : _castle setobjecttexture[_counter, "chain.paa"] ? (_counter <= _length) : _castle setobjecttexture[_counter, ""] ; Next section please _counter = _counter -1 ; Keep goin over the whole chain ?(_counter > 0) : goto DrawLoop exit Then, you can call this sqs file with the command: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> [_castle, 3] exec "\mycastle\setlength.sqs" This will give us a 3 metre chain on the castle referred to by "_castle". You'll need to call this over and over again during the drawbridge animation. If you need more advice, you should try the Addon Config and Scripting forum here. It's a little bit closer to what you want. Share this post Link to post Share on other sites
Guest Posted September 10, 2003 Quote[/b] ]Col Klink has done an animation tutorial and has some info about setObjectTexture as well. http://www.dc3d.co.nz/tutorials/index.htm Its something you do in the config rather than the model. Try brsseb's tutorial #9 http://www.ofp.info/brsseb I have done brsseb's tutorial 9and there is nothing in there abouth doing what i need. And i have been in contact with him, he is norwegian joust like me. And he dident know. But what you wrote Footmunch is very interesting, so i'll try to do it that way. I'll also check out Col Klink's tutorial. Share this post Link to post Share on other sites
LizardX 0 Posted September 11, 2003 Sorry if I don't understand you clearly... Create a small diameter cylinder object. Its first end will be the end in the wall, the other will connect to the gate. This object is your rope or chain. In O2 select the "gate" end the "gate-end part" of the rope simoultanously (but only the correct end of the rope, not the whole object). Name this selection whatever you will, give it an axis in the memory LOD, and this will be the object you move in the animation part of the .cpp. This could be used as hydraulic actuators too, just remember: one end fixed, the other moves with the door/gate/anything. Share this post Link to post Share on other sites
Guest Posted September 11, 2003 Quote[/b] ]Sorry if I don't understand you clearly... Create a small diameter cylinder object. Its first end will be the end in the wall, the other will connect to the gate. This object is your rope or chain. In O2 select the "gate" end the "gate-end part" of the rope simoultanously (but only the correct end of the rope, not the whole object). Name this selection whatever you will, give it an axis in the memory LOD, and this will be the object you move in the animation part of the .cpp. This could be used as hydraulic actuators too, just remember: one end fixed, the other moves with the door/gate/anything. I think you got me right, but i dont understand this, also footmunch's idea sounds good, but my problem is that the end of the chains that are going into the wall has to stay at the same place when the drawbridge goes up. But if i joust make a strait chain from the drawbridge and up to the wall, then the point where the chain go into the wall will move down the wall when the drawbridge goes up. So if somebody want to do this part for me, they will get credit for the work. Share this post Link to post Share on other sites
LizardX 0 Posted September 12, 2003 Yeah, we're talking about the same thing: if you select only one end of the rope to move, then the the other end (in the wall) will be fixed, it won't move! This results a "lenght-changing" effect. Share this post Link to post Share on other sites
Footmunch 0 Posted September 12, 2003 Liz, The end won't move, but the texture will get squashed, won't it? That's okay for a contiuous tex like the metal rod on a hydraulic ram, but it might look a bit strange with an alpha-ed chain mesh. Neo, The chain and the 'door' of the drawbridge should be two separate selections. You'll have to synchronise the animations yourself. Share this post Link to post Share on other sites
Guest Posted September 12, 2003 Oki, this is all a little to difficult for me i think. I have only started to learn o2 a month ago. LizardX or Footmunch would you consider doing this part for me? You will ofcource get credits for the work when the castle pack is released. Here are some features i have done/planning to do. -Working Steel Gate With moving Windlas -Working Drawbridge moving Windlas -Over 30 meters high Towers -Regular and hollow castle walls with archer (sniper holes) -Wall mounted torches that you can light (if it dont laggs to much) And maybee some stone houses and other stuff to place inside the castle The walls will come in different lenght and corners with 90 and 45 degrees. Also corner tower will be made. I know how to do everything exept the torches and the drawbridge chains. So plz help me. Share this post Link to post Share on other sites
BraTTy 0 Posted September 13, 2003 Footmunch wrote it all out,thats the method to use,the other way the texture will compress size with the arc and look funny edit: oh the chain is rising up the wall, hmm lettme think on that one only way i can think is offhand is: dont animate the chain with the bridge (take it off that axis) that way the chain will stay at the angle it is ,and do your hidden selections from the bridge side,major downfall is you would be working with micro hiddenselections that way,1 meter wouldnt look good as I doubt your bridge is 1 meter thick,and you still want to jiggle the chain some to look like its moving Share this post Link to post Share on other sites
Guest Posted September 14, 2003 Hi, i'am sorry but i cant get this to work. I have vasted my whole weekend trying to get this to work, but this shit is joust above me! So PLEASE is there someone out there who can do this part for me??? I,am afraid that if i sit here plundering whit this anymore i will go get my axe and smash my whole place in anger, ARGH!!!! Share this post Link to post Share on other sites
Footmunch 0 Posted September 25, 2003 Turns out that the setobjecttexture trick won't work on a building. I've got a version that works with Liz's 'squashy' method. Sleepers-Neo - do you have a place where I can upload a demo - my webspace is down for the next week. Share this post Link to post Share on other sites
AirwolfPL 0 Posted September 25, 2003 Turns out that the setobjecttexture trick won't work on abuilding. I've got a version that works with Liz's 'squashy' method. Sleepers-Neo - do you have a place where I can upload a demo - my webspace is down for the next week. Hmmm... what do you mean by "setobjecttexture trick won't work on a building"? Share this post Link to post Share on other sites
BraTTy 0 Posted September 25, 2003 Ya it will only work with something that has a cfgvehicles...but you can make a building into a vehicle class and do it that way,also could mount a turret and some sitdown positions,Zwaders bus stop is a good example Share this post Link to post Share on other sites
AirwolfPL 0 Posted September 26, 2003 Ya it will only work with something that has a cfgvehicles...but you can make a building into a vehicle class and do it that way,also could mount a turret and some sitdown positions,Zwaders bus stop is a good example OK, I've made some research... It seems it's not true that setObjectTextures will work "with something that has a cfgvehicles" - I've made a building equipped with several hidden selections - it obviously had cfgVehicles section in it's config file but - all of the hiddenSelections were visible and setObjectTexture wouldn't work... until I replaced it's parent class with Tank. I think it has actually more to do with simulation model than with cfgVehicles then. Share this post Link to post Share on other sites
Footmunch 0 Posted September 26, 2003 Airwolf - I think we're on the same page here. I couldn't tell whether the game engine was ignoring the sections[] in CfgModels, or the hiddenSelections[] in the CfgVehicles. Yeah, I was thinking about turning the drawbridge into a 'tank', but I had a nasty feeling that I'd end up jumping through hoops to get it to look like a building to the AI. For instance, if LAW soldiers start firing at the drawbridge, it will start to get a bit silly. I definitely agree that it's the 'simulation=' line that determines a _lot_ of the behaviour in game, regardless of the classes the addon is derived from. The squashed texture on the chain isn't too horrible. By the time you notice it, the door is at about 60 degrees from the horizontal, and you have to be 'looking for it' to see it. I'll post a demo next week, along with some scrim nets and hardened aircraft shelters that are gathering dust on my HD. Share this post Link to post Share on other sites
cbfasi 4 Posted September 28, 2003 This is done with the method LizardX suggests although the image was taken back in March 2003 (on original pic) It looks ok till the ramp is beyond that 45 dgree angle then you can really start to notice the shrinkage. To look like a chain, I used a flat chain texture placed on a pair of faces with one revered,, the next part was doing a length at 90dgrees to the first and moving the chain texture up slightly so when viewed at a slight angle it actaully looks like multiple chain links linked together. Share this post Link to post Share on other sites
SolidSnake-(SNK) 0 Posted September 28, 2003 Hi, it's me that started this topic, i have joust changed nick. I still havent gotten this chain stuff to work, anybody wants to help me with this one? Share this post Link to post Share on other sites
cbfasi 4 Posted September 28, 2003 1. I hope you worked out how to do the rotation for the drawbrdige to lower.. 2. This is the really simple bit.. a. Make you chain using a face with a chain texture on it.. b. Place chain where required om model, visuall fixing at the ends (ie windlass and end of drawbridge..) c. Reselect the drawbridge and then use vertice selection ADD the end of the chain that happens to to at the drawbridge end.. As the vertices move with the selction the face between the vertices happen to also move , they face will shrink silighty upon its lenght shortning, but this is still quite effective I hope this helps, particaulary as its the method that is used to produce the chains attached to the workign rear ramp of the carge ship (and its a rather large ramp) Share this post Link to post Share on other sites
SolidSnake-(SNK) 0 Posted September 28, 2003 Yes CBFASI i have the drawbridge moving the way it should, like on the ship, but i dont understand it, so if it's so easy why cant you or someone do it for me? I can send you the model and you fix it and send it back to me and i'll give you credit for the work. Share this post Link to post Share on other sites
SolidSnake-(SNK) 0 Posted September 28, 2003 Stupid Stupid me, i think i got it. All i did was to make the chain in one long piece, one end is in the wall, that end i dont do anything with, but the other end i connected to the drawbridge called SNKbridge. Is this right way to do it, does the chain part shrink now? Share this post Link to post Share on other sites
AirwolfPL 0 Posted October 5, 2003 If someone is still interested how to make chains etc. then check this out: Download: awcatapult.zip (390KB) LOL Share this post Link to post Share on other sites
cbfasi 4 Posted October 12, 2003 Teh cahin part will shrink now, and thas how i did it Share this post Link to post Share on other sites