Jump to content

SSG Plazmoid

Member
  • Content Count

    65
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About SSG Plazmoid

  • Rank
    Corporal
  1. When I tried creating "ReammoBox" I ended up with an ammo crate not the little ammo pouch so I don't think this is it. Am I wrong? Has anyone found what the little pouches are called? It would be easy to addAction to a player that would search for nearestObject looking for the correct object and then once you've got the object targeted you could delete it. It would be very handy to have a nearestObject command that gave back the type rather than you having to provide it even if it only works when running from the editor or something and not in a compiled mission.
  2. SSG Plazmoid

    Time events

    wow I didn't know _time was built in. You know how many times I've wanted to run timed events and tried _time = time @ (time - _time > 20):do something and of course _time changed right along with time so now I use _myTime to store a time. Anyhow, I wanted to ask what some tricky things you could do with _time?
  3. SSG Plazmoid

    Createvehics in mp

    I found this thread by searching for server AND crash. I'm getting random crashes in my CTI map and I wondered what generally can cause this. Just storing a bad element in an array isn't enough to cause the crash right? Will a crash happen if I attempt to execute a script on a bad element and what consitutes a bad element? One thing I've found caused a crash was running a drop command on a null object. This happened pretty easily when attaching smoke/fire scripts to a vehicle when it died. If the script ran too long, at some point the object disappeared (my respawn script probably) and boom. Now I always use position only for my drop command. [OFFTOPIC]: to ensure your fire is actually on a dead vehicle (beacause sometimes they move when you shoot them) wait a second then check if speed is zero and set it to zero if necessary. Then pass the position of the vehicle (not the object directly) to your drop script. In the drop command the last parameter would be "" where the object usually goes.[/OFFTOPIC] I'll compile a list of other things I see in my search: using createvehicle to create non-vehicle/non-building units (including gamelogic) instead of createunit can have unpredictable behavior. It was reported that a unit created using createvehicle will crash the server when it dies. Are there other common mistakes that can be made in code which will cause a crash? Will a typo in vehicle type when creating a vehicle crash? I guess I'll do some simple tests and see what my client does. I'm running 1.96 client and server btw. I'm trying to figure out what to look for but need some guidance in order to run my tests. thanks, Plaz
  4. There's a great list of actions on OFPEC which sadly seems to be down atm. http://www.ofpec.com/yabbse....id=9376 anyhow, I'm not sure whether or not the action I'm looking for is mentioned there. Does anyone know the syntax to force a unit to find cover (like giving the radio command to a unit). _unit action ["Find Cover"] maybe? not sure :/ Some suggestions for other tricky actions (or a link to a thread on this forum to some) would be appreciated. thanks, Plaz
  5. tried using hints to see when things were running and I determined my arrayTransServer.sqs was running on the server and arrayTransClient.sqs was running on the client but client didn't receive update. I used hints to determine what the array was doing on the server but the client didn't receive any update. So I chose to try something as simple as possible. I created a blank map, put the CoC_Server gameobject, a player unit, and a trigger set to true that calls a script. init.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> vehicles = [] CoC_PublicArrays = ["vehicles"]; CoC_ClientsReady = false; call loadFile "Network\init.sqf" exit myinit.sqs (called from true trigger after map start) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@CoC_ClientsReady ? (CoC_isServer):goto "server" ? (CoC_isClient):goto "client" exit #server vehicles = [1,2,3,4,5] "vehicles" call fPublicArray exit #client ~1 hint format ["%1",vehicles] ? (count vehicles > 0):exit goto "client" running on dedicated server joining as remote client I saw the link established message and then in the hint box []. I waited a suitable amount of time but the client vehicles array didn't change from an empty array. Am I wrong to expect the client vehicles array to be equal to the server vehicles array once publicArray is sent? I know it's not instantaneous so my loop ran indefinitely until the array changed. Not sure what else to try. thanks, Plaz
  6. Have tried to find some example missions utilizing NS 1.x and publicArray function. However I'm trying to send my array across isn't being received at the client. If there is a mission anywhere that I can download I'll be able to figure out how it works. Otherwise I'll post what I'm doing below: in init.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">vehicles = [] vehiclesMP = [0] westVehicles = [] westVehiclesMP = [0] eastVehicles = [] eastVehiclesMP = [0] CoC_PublicArrays = ["vehiclesMP","westVehiclesMP","eastVehiclesMP"]; CoC_ClientsReady = false; call loadFile "Network\init.sqf" ... then in myinit.sqs which runs only after mission start via a trigger set to true: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">... @CoC_ClientsReady ? (CoC_isServerDedicated) && (CoC_isServer) && !(CoC_isClient):[] exec "init\arrayTransServer.sqs" ? (CoC_isClient) && !(CoC_isServer):[] exec "init\arrayTransClient.sqs" arrayTransServer.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#top ~1 @ (count vehicles != (vehiclesMP select 0)) vehiclesMP = [count vehicles] + vehicles "vehiclesMP" call fPublicArray ~1 westVehiclesMP = [count westVehicles] + westVehicles "westVehiclesMP" call fPublicArray ~1 eastVehiclesMP = [count eastVehicles] + eastVehicles "eastVehiclesMP" call fPublicArray goto "top" arraytransclient.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vehiclesMPCount = 0 _westVehiclesMPCount = 0 _eastVehiclesMPCount = 0 #top ~1 @ (vehiclesMP select 0 != _vehiclesMPCount) _vehiclesMPCount = vehiclesMP select 0 vehicles = vehiclesMP - [_vehiclesMPCount] @ (westVehiclesMP select 0 != _westVehiclesMPCount) _westVehiclesMPCount = westVehiclesMP select 0 westVehicles = westVehiclesMP - [_westVehiclesMPCount] hint format ["%1\n\n%2",westVehicles,westVehiclesMP] @ (eastVehiclesMP select 0 != _eastVehiclesMPCount) _eastVehiclesMPCount = eastVehiclesMP select 0 eastVehicles = eastVehiclesMP - [_eastVehiclesMPCount] goto "top" so the idea is when the array changes on the server the server script wakes up and transmits the MP copies of the arrays. then on the client the client loop waits for the 1st element of the array (containing the number of elements) to be different from what it expects and then copies the MP arrays that were just received. Problem is I don't ever receive anything. I'm testing this by saving my map and copying on LAN to a dedicated server then joining that server remotely across the LAN from my client. When the game starts I see the link established message. Also I run a simple report script that watches the value of CoC_ClientsReady and the client does see this go true after a few seconds. thanks for any ideas, Plaz
  7. thank you very much for your reply and NS 2.0 sounds great! That's pretty exciting strings can now be sent. 4000 characters rings a bell from another conversation I saw about using dialogs as an ingame notepad. I was going to ask how the client would know when the array had fully arrived after the first element containing the new number of elements had changed (in your example). But I just realized that if that 1st element is sent first by the function then all I have to do is force the client to wait for count vehicles = vehicles select 0 to be sure the array is all there. regards, Plaz
  8. I'm attempting to integrate NS 1.2 into my CTI maps. The first thing I'd like to do is make server vehicle arrays available to the clients (I have some areas where this would be useful like a vehicle status script that shows your team's vehicles, grid location, and damage amount). I'm wondering how the client knows when the array has been received completely by the client? I'm looking through the documentation but I'm not seeing the answer. Sorry if it's there and I missed it. Could someone post a simple example of how to use CoC NS 1.2 to transmit an array from server to client. in init.sqs I've set the arrays: CoC_PublicArrays = ["vehicles","westVehicles","eastVehicles"]; then I believe I need to send the array information from the server later on. I created a script file run by the server: @CoC_ClientsReady #top @ (transmit) "vehicles" call fPublicArray "westVehicles" call fPublicArray "eastVehicles" call fPublicArray transmit = false;PublicVariable "transmit" goto "top" and finally when a client wants updated information it does this: @ !(transmit) transmit = true;PublicVariable "transmit" @ !(transmit) [EDIT] just so I'm complete with my explanation I'm using the script version and have added the gamelogic named CoC_Server in my map.[/EDIT] I'm sure this isn't the way to do it so wanted to asked here. Thank you for any advice/feedback. regards, SSG Plazmoid
  9. Does anyone know if unit say "sound" is local? In other words if a local player in a multiplayer game executes a script but only that player executes the script and the say command is used on a global object will other players hear the sound or does each player need to execute the say command locally? When I say will other players hear this is remembering that they must be within distance of the object. Btw, I mention object in reference to say because you can use a gameobject instead of a unit. I guess I'll get around this by making triggers and having them make my gameobjects say the sounds so in this way I'm sure all players (within range) will hear the sounds. The answer to this question would be good to know for future use. My usual response to a question like this is - test it. But don't have anyone to help me test at the moment thanks, Plaz
  10. SSG Plazmoid

    Cti- worst thing to happen to ofp

    I hope people find this post somewhat on topic as I want to address some (accurate) complaints about how CTI runs on some servers. When I began playing CTI on Stoner's SHoP server most games ended in a mess of desync often resulting in restarting the app. This was MF's original public version of CTI and it had some issues with code efficiency, lack of limitations on objects, and lack of limitations on what I feel are the MAJOR cause of maximum desync - HE guns, vulcans, and shilkas. I began reworking MFCTI and released several SHoP CTI versions and WGCTI up through version 1.58. Efforts were mainly in the area of reducing server load and improving server performance. I've tinkered with a lot of other stuff as well always with the idea in mind of helping games get resolved more quickly,hopefully improving fun, and reducing game stopping desync. If one is interested in the specifics of my newest version: http://www.soldbuysam.com/ofp/cti/changelog.htm My purpose of posting here is to hopefully interest some new people in CTI or perhaps those who were turned off by some of the issues mentioned above. If you hate CTI because it has no definite end or doesn't run well on servers maybe we can do something to help that. Finally, without the efforts of MF, CTI wouldn't be possible so despite the things I'd like to change/fix which are just my opinion, proper recognition for MF's achievement shouldn't be forgotten. regards, SSG Plazmoid
  11. SSG Plazmoid

    Individual ammo rounds

    I think he meant how to add single rounds of a given ammo not how to add this ammo or that ammo. Two ways I can think of are to either add a magazine and expend all but the amount you want it to have. With AI this would be kind of easy. Move them off someplace and have them somehow fire the appropriate number of shots. For players I don't know how to accomplish this without the player seeing it. Maybe black them out, do what you need to do, then unblack dunno. Another way is it possible to set the number of rounds of ammo for a given magazine type in an addon? Say you want to make your own m16 addon that loads 1 round magazines by default. Not very useful but wait you could make alternate ammo types for that weapon that come in 2,3,4,5,etc round magazines. Then you could just load the "ammotype" that's appropriate to how many rounds you want someone to have.
  12. overflowed ammo from a vehicle happens for two reasons I think. when a vehicle has weapons/ammo in cargo and you take a different weapon which automatically takes ammo for it you also automatically leave your current weapon and ammo. If you've exceeded the max cargo the extra spills out onto the ground. the worse version is when you are attempting to load weapons/ammo into a vehicle by using the "Put <weapon> to <vehicle>". If you put only 1 weapon in ever and take it out before putting in another then the worst overflow you'll see is mentioned in the first version. But if you forget there is already a weapon or try to put 2 in, ammo and/or weapons begin(s) spilling out onto the ground in a continuous loop. Eventually if left unchecked this condition (called "ammo bug") will eat up enough memory or cpu cycles to bring down the server. I was playing around with missile or bullet cams (which requires detecting fired objects) a couple of weeks ago and this got me wondering the exact same thing Karr asked about here. Do you have a script posted somewhere yet? Something else I can think of is to run scripts on vehicles that watch the weapons/ammo cargo and take action if too much is loaded. I'll do some testing to see if it's possible to head off either ammo problem with this method.
  13. SSG Plazmoid

    How to know the ground texture?

    looking through the helidust script I see the way to tell if you are over water or land is related to the abolute height of your position. If you are over water your height above sea level will be less than 3. If you are over land your height above sea level will go up the higher you go. Looking at vektorboson's script he creates an "EmptyDetector" object then checks it's height after moving it to the place in question.
  14. slightly offtopic from where this thread started but related to where we ended up... I've played some maps where if you got into an enemy vehicle it automatically changed to your side's equivalent. In other words as a west player if you entered a T80 it would become an M1A1 thereby eliminating the "showing up as enemy on radar" problem. I came up with a system that flies a "don't shoot me" flag on a vehicle you steal. The problem is when I started that idea I didn't know flagstatus is global. My hope was to show the flag only to those people on your team... What e really need is a script command to set whether an object should show on radar or not. object showOnFriendlyRadar = true/false object showOnEnemyRadar = true/false then you could have a radar jammer script that could set showOnEnemyRadar = false for any vehicle that you don't want to show on enemy radar. or you could have a script that watches a vehicle to see who is driving it. If it's an enemy you could show or not show as desired. But currently no way to do anything like this that I know of
  15. SSG Plazmoid

    Optimising performance in scripts

    OFP works on probabilities and some random factors right? One AI running into another AI came about because they each had a destination and happened to be in the same area around the same time. One noticed the other and they reacted. A suggestion would be to model this without actually drawing it if the player can't see it. It would still be true to the idea that zombies are wandering the countryside and killing AI units they come across or getting killed by them. You could run a test with everything as you have it now but even more zombies if that's what you are going for. Keep track of where zombies or other AI are killed, how often, etc. and use that data with some randomization to model a virtual war going on outside of the player's view. If your test finds that x% of zombies kill so many other AI and vice versa and you find the average period of time before another death occurs you can add some random elements to that and then script it. There will be (x% +/- random %) of each team left for the player to run into, dead bodies for the player to see, and a different experience for the player each time he moves through that mission. Could figure out how many bodies you want the player to see at any given time and move them around as needed. The goal is to make it seem like there are many more zombies/AI to the player while also trying to keep it "realistic" for the player to come across live/dead AI and scenes of battles.
×