Re: Cog makers... i need help...


[ Follow Ups ] [ Post Followup ] [ Jed Messages ]

Posted by CogKing on March 16, 1998 at 15:31:17:

In Reply to: Cog makers... i need help... posted by Master Milo on March 16, 1998 at 15:25:37:

> i edited this cog from the CTF cog ... the one used to transport
> just a note.
> # Mysteries of the Sith Cog Script
> #
> # Transport.cog
> #
> # The title is self-explanatory.
> # Enter the designated sector and you are transported to the ghost object.
> #
> # [YB]
> #
> # (C) 1997 LucasArts Entertainment Co. All Rights Reserved

> flags=0x240

> symbols

> sector mark_gold desc=mark_sector
> sector mark_red desc=mark_sector

> thing ghost nolink,desc=ghost

>
> model neutral_mdl=ky.3do local

> int player=0 local

> message entered

> end

> # ========================================================================================

> code

> entered:
> player = GetSourceRef();

> // Kill the player's velocity
> StopThing(player);

> // Then teleport him back up
> if(GetSenderRef() == mark_red) TeleportThing(player, ghost);
> if(GetSenderRef() == mark_gold) TeleportThing(player, ghost);

> // Give the player a neutral costume
> SetThingModel(player, neutral_mdl);

> Return;

> end


> first of all, i am nt a COG Master... [unlike CogKing who is]
> my problem is....
> how do i make so that there are SEVERAL ghost objects, and you can be
> randomly warped to any of them?
> like when entering a game, you can start at any of the walkplayers randomly.....
> can you hlep me so i can add say ... 4 more ghost objects and
> make the player appear at any one... at a random time?
> Thanx.

Simply make an array of ghost objects :

thing ghost nolink,desc=ghost
thing ghost1 nolink,desc=ghost2
thing ghost2 nolink,desc=ghost3
thing ghost3 nolink,desc=ghost4
...

if(GetSenderRef() == mark_red) TeleportThing(player, ghost[4*rand()]);
if(GetSenderRef() == mark_gold) TeleportThing(player, ghost[4*rand()]);

-CogKing


Follow Ups:



Post a Followup

Name:
E-Mail:
Subject:
Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Jed Messages ]