Modifié par painofdungeoneternal, 17 juillet 2013 - 06:28 .
"Change" the "OnHeartBeat" timing
Débuté par
Fabb_u
, juil. 11 2013 12:39
#26
Posté 17 juillet 2013 - 06:24
#27
Posté 17 juillet 2013 - 06:27
Fabb_u wrote...
Hi there, someone can answer to this question?
is there a trick in Neverwinter Nights 2 scripting (or other) to change the timing of the "OnHeartbeat" of an Area (that is about 6 seconds) ??
If i have to do an operation in my script about 4 times per second how can i do it ??
Maybe a "while cicle" in the script assigned to the "OnHeartbeat" event of the Area ??
thanks for answers !!
You want to use an ipoint, i create them via script as needed. Example i use for my weather control is as follows, i also rename it so it say environment if the script harms the player. You can create this multiple times, it only is actually able to create one, and the script can go anywhere - a seperate admin area which is really small is good for this sort of thing.
const string CSL_ENVIRO_HEARTBEAT_SCRIPT = "myheartbeatscript"
object CSLEnviroGetControl( object oThingInTargetArea = OBJECT_SELF )
{
object oModule = GetModule();
object oEC = GetLocalObject( oModule, "ENVIRO_CONTROL" );
if( !GetIsObjectValid(oEC) )
{
oEC = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_ipoint ", GetLocation( oThingInTargetArea ), FALSE, "plc_environmentcontrol");
SetPlotFlag(oEC, TRUE);
SetEventHandler(oEC, SCRIPT_PLACEABLE_ON_HEARTBEAT, CSL_ENVIRO_HEARTBEAT_SCRIPT); SetLocalObject(oModule, "ENVIRO_CONTROL", oEC);
/* Sets a custom heartbeat interval on a creature or placeable.
* Note that speeding up the heartbeat rate on a lot of objects will impact
* performance. Also, in the case of creatures, there is still a random
* modifier of up to 1 second added to the heartbeat interval, so it
* won't be a precise interval.
* oTarget - creature or placeable
* nMSeconds - Number of milliseconds. 1000 = 1 second
*/
SetCustomHeartbeat( oEC, 4000 );
SetFirstName(oEC, "Environment");
SetLastName(oEC, "");
}
return oEC;
}
Modifié par painofdungeoneternal, 17 juillet 2013 - 06:28 .
#28
Posté 17 juillet 2013 - 11:24
If there's ever another patch for the game (and I'm not holding my breath), hopefully the first thing they include in it is an iPoint blueprint without that annoying space at the end of the template string!
#29
Posté 18 juillet 2013 - 12:43
My solution for that is to keep a "base" module to start from with certain resources pre-installed, one of which is a copy of the basic ipoint blueprint without the space at the end.
#30
Posté 28 août 2013 - 03:29
Hm... where was this information three years ago? I actually tried the dragon age toolset half because it had more precise timing.
Do you think it is feasible using either technique above to make kind of an arcade style platform swing back and forth? I'm trying to envision any pitfalls ahead of time. If you can get the platform to destroy and re-appear 3 times a second and the player had a dialogue box to choose when to jump it should work right? Detecting the player's location happens far more often than on the heartbeats that's as far as I know.
Do you think it is feasible using either technique above to make kind of an arcade style platform swing back and forth? I'm trying to envision any pitfalls ahead of time. If you can get the platform to destroy and re-appear 3 times a second and the player had a dialogue box to choose when to jump it should work right? Detecting the player's location happens far more often than on the heartbeats that's as far as I know.





Retour en haut






