I'm trying to make a construction kit (it's a weapon) the only problem is there's no such thing as weap.held (it will drop a wall).
I was thinking of using messages, I've never done it before. I looked at the tutorial in the docs but no help. Could someone show me how?
Explain the situation further.
You have a weapon and you want it to do something. What exactly?
Bink Wrote:Explain the situation further.
You have a weapon and you want it to do something. What exactly?
I'm intrigued, also, but like Bink I'm not sure what you are going for here. Try to explain it a different way.
There's a quick messaging tutorial in the docs you might want to flip through, also.
[>] Brian
He wants to make a weapon that either holds a wall, and can drop it, or generates a wall.
Play tremulous. You can (optional) have a weapon that is a construction kit, and you can build turrets and generators and lots of stuff.
I think thats what he means.
You have used messages. when you get the speed boost in TT.
I once tried to make something like that, but I think it turned out that I am not very good at scripting and quickly abandoned the project. You'll probably want to make the walls projectiles, but I think the trouble is that if you want the turret to rotate, projectiles didn't seem to want to do that...
Messages would probably be the way to go, I remember Brian saying something about teleporting from a pool of usable objects. so you'd make a large pool (somewhere far away) of all the different things you can make, with meshes deactivated for optimization and such. Then have a projectile with no bounce or anything that is invisible (and you'll probably also want it to snap to locations and rotations, so that they aren't all haphazardly placed. In the projectile script, trigger with a starting message like:
Code:
proj.event.sendMessage(DIM3_MESSAGE_TO_SCRIPT,wall,foo#);
then you'll need to give the wall itself a case function for that, just like the player has.
Code:
case DIM3_EVENT_MESSAGE:
wallMessage(obj,subEvent,id); //something like this...
return;
and then the corresponding function:
Code:
function playerMessage(obj,subEvent,id)
{
if( subEvent == DIM3_EVENT_MESSAGE_FROM_SCRIPT )
{
switch( id )
{
case foo#:
check location of projectile somehow;
move to that location;
return;
}
}
}
I think that would work, but there's no guarantees. I think someone else will have to help you with differentiating each one and calling on them in order or something.
Hmmm .... there's no way to actually change the map segments other than moving/hiding them, which could work, but then you either have to have a limited number of them in the right position to unhide/move, which probably wouldn't work very well.
Using a pool of objects would work, but, again, that would be limited.
Is this meant to last forever (actually building into the map) or some kind of short lasting wall? Could their be limits?
[>] Brian
I have this weird problem in mp. Projectiles that use weapons seem to show up as the player model to other people and the player model doesn't have the animations that are required so the console won't go away. If I add the animations I still wont be happy because I want the projectile to use the correct model. I would have to use player messaging so it would drop the wall or turret, is that similar to that code dimwit gave me?