Five Elite Mercenaries are send to an Island in middle of the 1980'. The Task: Find and Eliminate a local Drug Baron. Features: new Physic, real Sunmovement, Day/Night Change, Hunger/Food system, realistic (!) Weather system, Light/Dark viewing system for AI, 5 different Fractions on the Island. Complete Realistic simulation of nearly all things, including Sleep. New weapons, new Vehicles. Vehicles driving system is now exact (!) like GTA IV , FireSystem,... this mod is Heavily inspired by GTA, IGI, FarCry.
Posts | ||
---|---|---|
scripting help needed | Locked | |
Thread Options | ||
|
Apr 9 2016 Anchor | |
in game there is a little "bug": if you drop a weapon, the pickup cgf will loaded on the fly: if this is the first time for the weapon, and the mesh is very complex, it can need up to 1 second which results in a one second engine freeze during gameplay. the same happens if you pick up a weaponpickup: activating a new weapon where the mesh is loaded the first time in engine, can result in a engine stuttering at this point. actually i preload on levelstart some critical models "by hand" (some preselected cgf's in a script). but the nice way would be, to step on mapstart trough all pickups and all equipement packages: for each pickup preload the weapon first person model and for each weapon in all equipement packs preload the pickup model, which will be spawned if this wpn is dropped by player or AI. first i started with pickups and try to get the weapon object phad, but i fail, this is, what i have: ------------------------------------
------------------------------------ and this is the M4.lua weaponscript with the object phad i need: ------------------------------------
------------------------------------ is there any way to combine the "M4" string from pickup with the M4.object to get the phad ? Edited by: pvcf |
||
Apr 9 2016 Anchor | ||
PreloadModel can be LoadObject for sake of simplicity. Freeze can't be eliminated within script this can be done only in CryGame C++, this of all you need learn what are Thread & how to use it, don't there are many tutorials & sample code there around a net. |
||
|
Apr 10 2016 Anchor | |
many thanx for your input, Arn ! unfortunately my c++ coding knowledge is still to bad to do such things, so i have to fight with lua because i know it the idea for precatching a cgf is for levelstart, not eleminating the enginefreeze in realtime, i have the enginefreeze on levelstart in a row, instead by collected and activating a weapons each. it was a long way, my first idea, after realizing i dont can create the correct table name, was, to parse trough WeaponParams.lua, compare there the weapon name string with wpn name from pickup and get there the from fireparams merged table entries, like object and char cgf. but after i have coded that, i found out that the merge procedure is done by a c++ routine for playerentities by activating this weapon (choosing as active weapon). so, this is now the cleanest way i found:
however, this is the solution for weaponpickups, i will investigate now for the other case: precatch weapon drops from weapons which player drops from inventory and where engine create a pickup for. Edited by: pvcf |
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.