PDA

View Full Version : Need a cog



sskakarot51
03-24-2003, 12:37 PM
I need 2 cogs each is very important.

1. I need a cog that has two switches. When either is activated it will push a selected object on a vector. i want to be able to control how long the thrust is active and the speed if possible. then it will sleep for x amount of time and it will go back on another vector for the same time. the idea is to create a SHUTTLE craft that can carry people from point A to point B and back again if necessary without the use of KEYS .

2. i need a cog for sector damage. You can specify up to 5 sectors and it will damage you slowly BUT if you are touching a specific object you will not recieve damage. this way if your in the shuttle you can breath but if you leave the shuttle while in space you will slowly suffocate. these are both 2 very importan things and ifanyone can find something simlar or make them id be greatly appreciative

------------------

zagibu
03-24-2003, 01:06 PM
You could use frames for the transport and use a generic elevator cog to move it.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)

sskakarot51
03-24-2003, 01:41 PM
frames???

------------------

DSLS_DeathSythe
03-24-2003, 02:03 PM
Here is a cog you could use for the sector damage.


#Written By DSLS_DeathSythe
flags=0x240
symbols
#-----
message startup
message pulse
#-----
sector dmg_sec1
sector dmg_sec2
sector dmg_sec3
sector dmg_sec4
sector dmg_sec5
#-----
thing shuttle=-1
flex dmg_spd=1.0
flex dmg_amount=10.0
flex nodmg_range=0.5
#-----
thing player=-1 local
sector plyr_sec local
#-----
end
#-----
code
#-----
startup:

player = GetLocalPlayerThing();
SetPulse(dmg_spd);

return;
#-----
pulse:

plyr_sec = GetThingSector(player);
if((plyr_sec == dmg_sec1) ||
(plyr_sec == dmg_sec2) ||
(plyr_sec == dmg_sec3) ||
(plyr_sec == dmg_sec4) ||
(plyr_sec == dmg_sec5))
{
if(VectorDist(GetThingPos(player), GetThingPos(shuttle)) > nodmg_range)
{
DamageThing(player, dmg_amount, 0x1, player);
return;
}
return;
}
return;
#-----
end

Instead of the player having to be touching an object, he has to be close enough to the
shuttle wich should work almost the same.
Just adjust the nodmg_range to where you need it. If the player is within that range he shouldnt get hurt.
I havent tested it but it should work. Hope it is something you can use.

As for the other cog, it would be easier if you used frames like zagibu said.
Check the tutorials to see what they are.

------------------


[This message has been edited by DSLS_DeathSythe (edited March 24, 2003).]

zagibu
03-24-2003, 03:00 PM
Well, ever heard of doors or elevators? Do you know how they work? If so, add frames to your shuttle and move it using a (modified, if necessary) elevator cog.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)