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 → Chase The Bots - Teleport Cog
Chase The Bots - Teleport Cog
2001-07-21, 7:45 AM #1
Hello. First, please visit http://forums.massassi.net/html/Forum2/HTML/007908.html on details about this message.
Okay. On that note, I need this teleport cog to work with RBots so the bots will teleport also. Thanks to Nightmare for writing this great COG.
Code:
# teleport.cog
#
# Teleports the player to a ghost position upon entry into a sector 
#
# Nightmare (6/16/98)
#============================================================================
flags=0x240

symbols
message entered
message startup        

sector	telechamber

thing	gotospot
                                
int 	player  		                local
int     dummy                                   local

sound   telesound=ForceThrow01.WAV

template	sparks=+telesparks

end

#============================================================================

code
entered:
	player=GetLocalPlayerThing();
	StopThing(player);	

	dummy = CreateThing(sparks, player);
        
        dummy = PlaySoundLocal(telesound, 1.0, 0, 0);
        
        TeleportThing(player, gotospot);

	dummy = CreateThing(sparks, player);

	return;
end

Can anyone help? Thank you.
2001-07-21, 9:36 AM #2
cross posting is against the forum rules
*scribbles name on wall*

------------------
*eats pie*
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2001-07-21, 9:52 AM #3
*scribbles on MidgetBasher* HAR HAR HARRRR!

replace the GetLocalPLayerThing(); with GetSourceRef();
that might teleport weapons too, im not sure, but that would be kinda cool too [http://forums.massassi.net/html/biggrin.gif]
I'm just an old man with a skooma problem.
2001-07-21, 1:50 PM #4
Thanks gunboy. That's what I want it to do in another level of mine, teleport weapons. Sounds great, I'll try it.
2001-07-21, 3:02 PM #5
Ok, all you need to do is to first have a read through my latest addition to the Rbots tutorials. It has a section at the end which describes how to modify custom cogs to work with the bots.

Anyway, all you need to do is change the mask for the sector that is being entered (as well as the change GuNbOy has already mentioned).

Code:
sector	telechamber mask=0x404


This changes what can generate the 'entered' message. Normally actors don't generate messages, so when the bots entered the sector, your cog was never sent an 'entered' message. Mask 0x404 allows both players and actors to generate messages.

Also, I'm sure you will need to remove the 'flags=0x240' at the top of the symbols section.


Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here

[This message has been edited by Raynar (edited July 21, 2001).]
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2001-07-21, 5:29 PM #6
Man thanks. I would definetly dedicate this level to Raynar if I had anywhere to put it. Hmmm....
Thanks for RBots, man. Me and my buds (NO COMMENT NESSISARY) play it all the time.
2001-07-22, 7:52 AM #7
Okay, okay. Some more help needed with this. It is directed towards the bots in general. Passive bots? I can't really have them attack AT ALL. I've turned off Sabers and Weapons, but they still punch. Help???
2001-07-22, 1:03 PM #8
Ok, open up 'rbot-srv2.cog' and search for the 'firetarget:' routine. Place a 'return;' immediately after it and the bots will never fire.

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2001-07-22, 4:12 PM #9
Well, the teleport cog is fixed. It does transport the bots. But, Raynar, is there a Mask=0x??? that allows weaps to send messages too? That'd be great. And thanks for the bot help on attacking. I think that'll kinda help :-P

Thanx
2001-07-22, 5:37 PM #10
From the JK-Specs:

Thing Type . Mask value
1 ? 0x2
2 Actor 0x4
3 Weapon 0x8
4 ? 0x10
5 Item 0x20
6 Explosion 0x40
8 ? 0x80
10 player 0x400

As you can see, you can make whatever you like generate messages. If you want players+actors+weapons, you would use 0x400 + 0x4 + 0x8 which is 0x40C (use the Hex<->Dec calculator in Windows). If you just want absolutely everything to generate messages, just use 0xFFF

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2001-08-14, 2:42 AM #11
Um, also, instead of attacking, they hover around me. Like they want to but can't. Is there a way to just make it so they can only run and not even think about attacking? (Without redoing the entire RBots code)
2001-08-14, 1:54 PM #12
Ok, open up rbot-srv.cog, and go to the 'move:' section.

Near the end of this section is some code that looks like this:

Code:
if (BitTest(botmode,0x4000)) // bot has target
{
    AiSetLookPos(rbot, getthingpos(target));  // look at target
    call targettactics;
}
else
{
    AiSetLookPos(rbot, getthingpos(newpos)); // look at move position
    call movenode;
}


change it to:

Code:
AiSetLookPos(rbot, getthingpos(newpos)); // look at move position
call movenode;


This will prevent the bot ever moving towards the target.

Raynar



------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis

↑ Up to the top!