Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - DaBlocko

Pages: 1 2 3 4 5 [6] 7 8 9 10 11 ... 51
76
Modification Help / Access SimSet(SimGroup?) of bricks on the server
« on: January 12, 2017, 10:35:40 PM »
Is it possible to access the SimSet of bricks (Or is it SimGroup? whatever), on the server in an event, without the ClassName of the event being fxDTSBrick?

This is an output event.

77
General Discussion / Re: It is Redconer's fifth year on Blockland
« on: January 12, 2017, 10:33:07 PM »
Wh-

I didn't mention forums.
Why no you did not. Heh.
Happy blocklandday!
Idfk when I started playing exactly.  I think before I joined the forums tho O_O

78
General Discussion / Re: It is Redconer's fifth year on Blockland
« on: January 12, 2017, 08:05:00 PM »
Happy forumday!

Off topicish: Oh wow I'm coming up on my 7th year of being on the forums.  The memories.

79
Add-Ons / Re: Filipe1020 Add-Ons Topic
« on: January 12, 2017, 02:58:38 PM »
Yo dude, where can I find a download of the Brent Aero, I've searched in the forums and Blockland Glass but it seems to not be there
Google is glorious.

Also is the Hydric Touring an update to the Nakata Hydric, or is it meant to be a separate car?

80
Modification Help / Re: Cancelling a function
« on: January 10, 2017, 01:54:41 PM »
Check if %col is an object before you do things with it. Other than that, I haven't dealt with this kind of issue before, so someone else might fill me in with more info of what you could do.
Checked it and %col is indeed an object.

81
Modification Help / Re: Cancelling a function
« on: January 10, 2017, 12:57:40 PM »
Empty string. Setting it to 0 is also valid, but will only reset the variable state, not remove it.
Sweet, thanks.

And one final question (I hope).
Whenever I leave the vehicle, I get this warning in the console:
Code: [Select]
Add-Ons/Vehicle_KeiCarRacing/KeiCarRacing_Sounds.cs (54): Unable to find object: '' attempting to call function 'getDataBlock'
BackTrace: ->Armor::doDismount->[HandsOnVehicleSupport]Armor::onUnMount->[KeiCarRacing_EngineSounds]Armor::onUnMount

Whats the reason for this?  When you unMount it doesn't know what object you just unMounted from so it has to backtrace?  Is there an easy way to fix it?

Edit: Oh another one yay.
Due to scheduling time (I believe), if you enter and exit the vehicle quickly the vehicle sound continues to play and wont stop unless its respawned.  I added
 
Code: [Select]
%obj.getMountedObject(0) == -1to the If statement at the beginning of the SpeedCheck to attempt to fix this (thus, when there is no player, it won't continue playing the sound).
Code: [Select]
if(!isObject(%obj) || %obj.getMountedObject(0) == -1) {
return;
}
Apparently thats not the right function to use as now it only plays the sound that corresponds with the speed of the vehicle when you entered (i.e. doesn't change sound based on speed).
Edit: should've been getMountedObject (still doesn't work).


Fixed!  Used getMountedObjectNode instead.

82
Modification Help / Re: Cancelling a function... It works!
« on: January 09, 2017, 01:01:24 PM »
Update! It works!
Code: [Select]
package KeiCarRacing_EngineSounds
{
function armor::onMount(%this,%obj,%col, %slot)
{
Parent::onMount(%this,%obj,%col, %slot);
if (!isObject(%col) || %obj.getMountNode() != 0)
return;

if (%col.getDataBlock().vehicleSounds) {
%col.playAudio(0, KeiCarRacing_StartupSound);
schedule(1800, 0, KeiCarRacingSpeedCheck, %col);
}
}
function armor::onUnMount(%this,%obj,%col, %slot)
{
Parent::onUnMount(%this,%obj,%col, %slot);

if (%obj.getMountNode() != 0)
return;

if (%col.getDataBlock().vehicleSounds) {
cancel(%col.engineLoopSched);
%col.playAudio(0, KeiCarRacing_ShutOffSound);
}
}
};
ActivatePackage(KeiCarRacing_EngineSounds);


function KeiCarRacingSpeedCheck(%obj)
{
if(!isObject(%obj))
return;

%vehicle = %obj;
%slot = 0; //Play the sound in the driver's spot
%speed = vectorLen(%obj.getVelocity());

//We use else if's so that it will find a true statement then skip the rest
if(%speed < 4)
%vehicle.playAudio(%slot, KeiCarRacing_IdleSound);
else// if (%speed < 20)
%vehicle.playAudio(%slot, KeiCarRacing_ThrottleSound);

%obj.engineLoopSched = schedule(500, 0, KeiCarRacingSpeedCheck, %obj);
}

Thanks for the help on this!

Preferably would be to clear the variable out as well to avoid undefined results.
Whats the syntax to do this?

Edit: Also figured out why I was standing when mounting instead of sitting.  Forgot to include %slot in armor::onMount and onUnMount (and subsequently the Parent functions).

Also could someone explain why changing "armor" to something else doesn't call the function?  Is there something inherent about "armor" that is tied to mounting in TS?

Thanks for all the help!

83
Modification Help / Cancelling a function
« on: January 09, 2017, 12:54:39 AM »
Practically got me tearing my hair out, gonna post and then go to bed.

So.  This package
Code: [Select]
package KeiCarRacing_EngineSounds
{
function armor::onMount(%this,%obj,%col)
{
Parent::onMount(%this,%obj,%col);
if (!isObject(%col) || %obj.getMountNode() != 0)
return;

echo(%col.getDataBlock().vehicleSounds);
if (%col.getDataBlock().vehicleSounds) {
%col.playAudio(0, KeiCarRacing_StartupSound);

schedule(1800, 0, KeiCarRacingSpeedCheck, %this, %col);
}
}
function armor::onUnMount(%this,%obj,%col)
{
Parent::onUnMount(%this,%obj,%col);

if (%obj.getMountNode() != 0)
return;

if (%col.getDataBlock().vehicleSounds) {
cancel(1);
%col.playAudio(0, KeiCarRacing_ShutOffSound);
}
}
};
ActivatePackage(KeiCarRacing_EngineSounds);

Does not work how I want it to (and I'm not sure why).  Specifically, the cancel in the second function.  This cancel is called on a schedule in the KeiCarRacingSpeedCheck function to cancel out the schedule at the end:
Code: [Select]
function KeiCarRacingSpeedCheck(%this, %obj)
{
if(!isObject(%obj))
return;

%vehicle = %obj;
%slot = 0; //Play the sound in the driver's spot
%speed = vectorLen(%obj.getVelocity());

if(%speed < 4)
%vehicle.playAudio(%slot, KeiCarRacing_IdleSound);
else// if (%speed < 20)
%vehicle.playAudio(%slot, KeiCarRacing_ThrottleSound);

schedule(500, 1, KeiCarRacingSpeedCheck, %this, %obj);

}

Whats happening is as follows:

I enter the car, and the audio for the startup sound is played.   The KeiCarRacingSpeedCheck function then kicks in and plays the current sound corresponding with the speed.  However, with the cancel, that schedule is apparently ended right away.  The speed doesn't update if I'm going as fast as possible.
I also know that it cancels it because if I comment it out, once I get in the car, it makes noises until I break the brick.

Can someone point out my mistake?
Should I (can I?) just be using states for this?


Also as a total side note, for whatever reason, if I change the "armor" name(space?) of the two functions to something else, they won't execute.  The framework for this code was ripped from Filipe's SuperKart mod and subsequently has the same name as one of the functions in Support_HandsOnVehicle.  Activating my KeiCarRacing_EngineSounds also causes the player to stand inside the vehicle instead of sitting.  If anyone has an answer as to why they won't execute and the player stands I would love that as well.

Honestly I am incredibly new to TS so if there is something glaringly horrible that I'm doing please let me know!  Thanks for whatever help I can get!

Tags: Cancelling, function, car sounds, sounds

84
Modification Help / Re: Wait between functions
« on: January 08, 2017, 10:14:12 PM »
More questions yay.

Is there any way to go above 999ms?  Anything over that seems to not play the sound.

Nvm it does.  Got a lot of coding to do it seems.

85
Modification Help / Re: Wait between functions
« on: January 08, 2017, 09:42:30 PM »
Code: [Select]
%obj.playAudio(0, StartupSound);
%obj.schedule(500, 0, "playAudio", 0, ShutdownSound);
This should work i believe.
Oh that makes sense.  The schedule function I was looking at was calling its surrounding function thus looping it.

86
Modification Help / Wait between functions
« on: January 08, 2017, 09:22:01 PM »
Is there a way to wait between function calls?
For example:
Code: [Select]
%obj.playAudio(0, StartupSound);
wait(500);  // would wait for 500 ms
%obj.playAudio(0, ShutdownSound);

87
General Discussion / Re: Scenery's SUBURBIA [FOOD BRICKS BY TROGTOR]
« on: January 08, 2017, 05:02:00 PM »
if i care enough i will
I would love if you did, seems like a pretty awesome addon!

Suburbias looking amazing, looks like it will be better than most city rpgs have been in the past!

88
Add-Ons / Re: Blockland Glass 3.2.1
« on: January 07, 2017, 10:41:38 PM »
these are our current categories
Will there be a vehicles section?

Also, as a total offtopic and not 100% necessary, would it be possible to also include the addon descriptions for the RTB archive section?  Currently I use Glass or Swollow's archives to find the addon and orbs to actually figure out if I need it.  It would be wonderful if everything was consolidated tho.

Good work on Glass everyone!  Honestly so nice to have this kind of service again.

89
Modification Help / Vehicle Sounds
« on: January 06, 2017, 11:38:23 PM »
I'm currently attempting to add sounds to Filipe's KeiCar pack.  Using Filipe's SuperKart files, I've copied over code that I'm 99% sure is correct, and yet it doesn't seem to work.  I've attached both files (SuperKart and modified KeiCar pack).  Can someone verify that I'm not insane and then possibly help?

KeiCars
SuperKarts

Before posting I did a bit more testing... and SOMEHOW got the Cronus to have sounds, but the CronusTuned does not have sounds.
Apparently I didn't even upload the one with sounds.  I also got the Tuned version working as I hadn't actually executed the .cs file.  Oops.  Updated link.
Cronus(includes Tuned version)

Got all the sounds working.  Message me if you need help on how it works.

Tags: Vehicle sounds, sounds, engine rumble

90
General Discussion / Re: Scenery's SUBURBIA [FOOD BRICKS BY TROGTOR]
« on: January 06, 2017, 05:25:20 PM »
Is there a chance that you will release the engine sounds mod that you made?  And if you do, how easy is it to add support for other vehicles.

Pages: 1 2 3 4 5 [6] 7 8 9 10 11 ... 51