Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → changing concrifle to a teleporter
changing concrifle to a teleporter
2003-12-28, 3:11 PM #1
I changed the model to look like the mines, but now i want it so when i press fire 1 it places the mine, and fire 2 to teleport to it.
2003-12-29, 5:01 AM #2
Replace the activated message in the code with this.
Note use of code tags.
Code:
Activated:
   offset = '0 0 0'; // change the numbers in here to offset the placing of the projectile from the player
   player = GetSourceRef();
   mode = GetSenderRef();
   If(!mode) // Primary, drop teleport point
   {
      If(target != -1) DestroyThing(target);
      target = FireProjectile(player, temp, -1, 12, offset, '0 0 0', 0,0,0,0);
   }
   Else // Sec fire
   {
      If(target == -1) Return; // If theres a target point
      TeleportThing(player, target); // teleport line
      DestroyThing(target);  // Remove point
      target = -1; // safeguard
   }
   Return;

Remove any fire or deactivated messages. Then add these to the symbols.
Code:
int       player     local # if not present already, just this one
thing     target=-1  local
vector    offset     local
template  temp=templatename local
and that should do it, unless you want ammo change or whatnot.

edit - fixed errors

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

The 2 riddle!

[This message has been edited by Descent_pilot (edited January 01, 2004).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-12-30, 10:58 AM #3
All it dose now is act as the weapon that i selected before.
2003-12-30, 11:10 AM #4
use sabermasters parsec to find any errors, the problem is your cog as a error.

------------------
I am pjb.
Another post......
another moment of my life wasted.....
at least i made a level.
PJB's JK page's

-the PJB jedi rule book-
rule one, "never trust a bartender with bad grammar"-kyle katarn in JO

Rule Two, "Gravity is a crule misstress" -kyle katarn in MotS, and the alternatior MK I in AJTD
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-12-30, 11:41 AM #5
Never heard of that, where do i get it.

And remember this is going to be a part of a mod so i dont have to worry about a checksum.

[This message has been edited by RayOfAsh2 (edited December 30, 2003).]
2003-12-31, 3:36 PM #6
there's one error in the code I gave you, but it won't cause that problem, cause mines a logic one. Change the 'If(target != -1) Return;' to 'If(target == -1) Return;'
Everything else in my code seems to be clean.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

The 2 riddle!

[This message has been edited by Descent_pilot (edited December 31, 2003).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-12-31, 9:21 PM #7
A couple things I noticed:
You need a ';' after offset = '0 0 0'.
Second, I think the code should be under the fire message and leave the activated/deactivated messages the way they are.
Correct me if I'm wrong, I havn't messed with weapons too much lately.

------------------
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2004-01-01, 5:26 AM #8
whoops *adds semicolon after vector* okay, my fault, just add the semicolon, it should work, but its semi-auto. One tap, one drop, for you don't need it to repeat, thats why its just activated.

Updated the whole code to work.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

The 2 riddle!

[This message has been edited by Descent_pilot (edited January 01, 2004).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2004-01-01, 9:28 AM #9
The offset needs to be "offset=vectorset(0, 0, 0);" for it to work.

------------------
Duel Zero key count: Zero! Down to guns and forces. Expect a release soon.
2004-01-02, 8:27 AM #10
no, it can be "offset = '0 0 0';" too, but you can only use it for flex and ints, you can't use a variable or Rand() or any other verb. ie the '0 0 0' can only take numbers. Otherwise you have to use VectorSet().

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

The 2 riddle!
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2004-01-14, 2:46 PM #11
Okay thanks a bunch.

Only 1 problem now. How do i edit the templates? I dont want +seqchrg2 to explode when anybody walks near it. And i want to change its name so it wont interfear with weapon 8?

Or where can i get a list of templates that cant be picked up, and dont explode.

[This message has been edited by RayOfAsh2 (edited January 14, 2004).]
2004-01-14, 10:06 PM #12
Hi there [http://forums.massassi.net/html/smile.gif]

All the template settings are stored (in JK) in the file "master.tpl" or (in MotS) "mots.tpl" file.

If memory serves me correctly, I believe +seqchrg2 has a template explosion setting (I'm at work and don't have any resources readily available to check...) - just simply remove that (plus the damage thing/type flags).

As for proximity checking when people go near it - you'll need to write a class cog for the droppable item (which has been pretty much written for you [http://forums.massassi.net/html/smile.gif]). Personally, I'd create a new template similar to +seqchrg2, but based more of its parent template (dang - can't remember what its parent is off the top of my head - sorry [http://forums.massassi.net/html/frown.gif] ).

Hope some of this information is helpful/useful [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
"lucky_jackpot is the smily god..." - gothicX

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||

↑ Up to the top!