Author Topic: [SOLVED] General TARDIS help topic  (Read 5814 times)

I need to know how to make a vehicle absolutely vanish--setting opaqueness to 0 will make it so you see the sky through it--hardly vanishing. I need it to be invisible but still there and still an object you collide with.

&

The third line of this errors. It says: Unknown command unmount
Code: [Select]
function Armor::onUnmount(%this, %player, %a, %b, %c, %d ) {
echo("debug");
Parent::onUnmount(%this, %obj, %a, %b, %c, %d);
if (%player.oldPos) {
echo("now");
echo(%player);
echo(%player.oldPos);
// oldPos(%player.client);
schedule(0,%player,oldPos,%player.client);
//for some reason 0 works
schedule(100,%player,eraseOldPos,%player);
//having right after shedule will cause this to fail
}
else {
echo("nu");
}
}
&
How do I write & read to config files? [STILL NEED HELP. NOT SOLVED. SERIOUSLY IT'S NOT.]
&
How do I get the length of a table/array? [STILL NEED HELP. NOT SOLVED. SERIOUSLY IT'S NOT. I CAN'T EVEN DO ANYTHING UNTIL THIS IS SOLVED.]
« Last Edit: November 28, 2014, 12:43:56 AM by superdupercoolguy »

Use ::onUnMount
Also %player is undefined, I missed that in your last thread

Code: [Select]
//copyright 2014 Jackson McNeill
//you are free to copy, modify, and distribute, but you must keep this license
Top kek. Also you don't need the server commands in a package, as they don't parent anything, but it's a matter of personal preference. As well as some of your indentation being odd.

Another thing I'd bring up is the commenting style
You don't need to comment every single line, especially stuff like this:
//add 0 2 2 to it
%pos = vectorAdd(%pos, "0 2 2");

because it's an extremely short and straightforward line, you can tell what's happening just by looking at it,  the comment just makes the code longer

What I do is split into "blocks" (loops, if...else... structures, groups of related code, etc) and give a summary of what's happening in that block
If I have really long conditions, i'll comment a short summary of it. Anything a reader might look at and ask "why are you doing that?" you can explain with comments


I recommend you keep similar questions to one topic. You did not need to start a new topic for this, its the same thing as your last.

I need to know how to make a vehicle absolutely vanish--setting opaqueness to 0 will make it so you see the sky through it--hardly vanishing. I need it to be invisible but still there and still an object you collide with.

%vehicle.hideNode("ALL");

and, then,

%vehicle.unHideNode("ALL");

The third line of this errors. It says: Unknown command unmount

No idea. Aside from the fact that you have two extra variables, which shouldn't break anything, that seems fine to me.

How do I write & read to config files?
What kind of config file? You can use export("$VariablePrefix::*", "config/destinationFile.cs"); or someScriptObject.save("config/destinationFile.cs"); or you can use file objects to save data in a custom format with (%fo = new fileObject()).openForWrite("config/destinationFile.cs"); %fo.writeLine("Hello World!"); %fo.close(); %fo.delete();

Don't edit out your question with a new one, make a new post (in this thread) instead, for two reasons
1. Editting destroys the "archive" that a help forum provides
2. I didn't know you had a new question until now

The error is because (as far as you've posted) the function isn't in a package
Also if (%player.oldPos) needs to be changed back to how i posted earlier

%vehicle.hideNode("ALL");

and, then,

%vehicle.unHideNode("ALL");
As you're making a tardis, it'd be much more realistic if you have a function that changes the alpha value every 16 milliseconds or so, then when the tardis has disappeared and reappeared a few times(as the tardis does), just keep it invisible.

As you're making a tardis, it'd be much more realistic if you have a function that changes the alpha value every 16 milliseconds or so, then when the tardis has disappeared and reappeared a few times(as the tardis does), just keep it invisible.
"alpha value" ???
Right now my plan is it use transparency to slowly vanish, thought that means you see the sky instead of what's really behind it when you look through the transparent stuff. After it's done with that, it will set itself invisable with $trinick's vehicle.hideNode("ALL"); and wait 2 seconds and reverse except unHideNode
Keep in mind, I might not be new to programming in general, but I'm new to C++ & 3D
« Last Edit: November 13, 2014, 08:00:12 PM by superdupercoolguy »

alpha refers to transparency in this context. So, a combination of setNodeColor that brings it down to 0 transparency and once it gets to 0 transparency hide ALL nodes.

Keep in mind, I might not be new to programming in general, but I'm new to C++ & 3D
This is torquescript, not C++

The problem with setting alpha levels is that things like water and etc. disappear when you're looking through the tardis.

Thats why a quick fade is better than a slow one. Fading to 0% opacity over 500ms only results in half a second of being able to see through things, which is much better than it instantly disappearing.

If you have access to the model, you can assign the transparency tag onto it, which will cause it to render properly when transparent. I had a similar problem with my static shape 'hologram' events. Its the same reason you can use a transparent feather accent to see through bricks.

1. Access to the model in what way? Currently the vehicle I'm using is in a completely seperate mod
2. How does one assign a transparency tag?
« Last Edit: November 14, 2014, 11:15:34 PM by superdupercoolguy »