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 → so thirsty...
so thirsty...
2000-12-04, 4:25 PM #1
i need a cog that when you activate a surface, a sound is played and a thing (bacta tank to be specific) appears at a ghost position. any help?

------------------
I chose the red pill, then lots of white rabbits told me to burn things.
I chose the red pill, then lots of white rabbits told me to burn things.
2000-12-04, 5:47 PM #2
Don't give me credit, I just modified minetrap.cog from this site, I don't know what sound you wanted so you'll have to do that too, the bets way is to open up jed, select a sector and press enter, double click sound, find the sound you want, copy it, cancel, open this cog and paste over the existing sound, then save and play.

be sure to save this as something like "bactameswitch.cog" in ms-dos text format.

I hope this helps: it does work, I actually made a quick level and tested it.

[http://forums.massassi.net/html/wink.gif]

Code:
# Jedi Knight Cog Script
# ========================================================================================

symbols

surface	switch			desc=switch

thing		tdg1			nolink,desc=tdg1

int		rounds=1		desc=rounds

flex		rate=0.1		desc=rate
flex		delay=3.0	desc=delay

int		firing=0		local
int		cur_round=0	local
int		dummy			local

template	proj_tpl=bactatank	local

sound		on_snd=set_hi2.wav	local
sound		off_snd=lgclick1.wav	local

message		activated

end

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

code

activated:
	if(firing == 1) Return;

	firing = 1;
	dummy = SetWallCel(switch, 1);
	dummy = PlaySoundPos(on_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
	

	cur_round = 0;
	while(cur_round < rounds)
	{
	 dummy = CreateThing(proj_tpl, tdg1);
	 Sleep(rate);

	 cur_round = cur_round + 1;
	}

	Sleep(delay);
	dummy = SetWallCel(switch, 0);
	dummy = PlaySoundPos(off_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
	firing = 0;
	Return;

end


if you need help figuring this out email me and I'll go into more detail.

[url="mailto:nesseight@aol.com"]mailto:nesseight@aol.com[/url]nesseight@aol.com</A>

[This message has been edited by TSM_Trendy_Ness (edited December 04, 2000).]
2000-12-05, 7:39 AM #3
thanks man
I chose the red pill, then lots of white rabbits told me to burn things.
2000-12-07, 11:43 AM #4
forgot one detail, it needs ot deduct 40 points of shields each time
I chose the red pill, then lots of white rabbits told me to burn things.
2000-12-08, 9:56 AM #5
so what would i put in the code to do that?
I chose the red pill, then lots of white rabbits told me to burn things.
2000-12-11, 4:09 PM #6
common guys, could you just tell me the line?

------------------
I chose the red pill, then lots of white rabbits told me to burn things.
I chose the red pill, then lots of white rabbits told me to burn things.
2000-12-12, 3:11 AM #7
I'm not sure but i think that it's like that:
after line
dummy = CreateThing(proj_tpl, tdg1);
add line
ChangeInv(player, bin, -40.0);
and then add to symbols section line
int bin=60 local

Hope it eorks...


------------------
He loves best who prayed best,
all things both great and small,
for the dear God who loved us,
He may ain't love at all.
WHAT?
2000-12-12, 5:02 PM #8
right before that, you need
Code:
player=getsourceref();
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2000-12-13, 12:07 PM #9
right before...

ChangeInv(player, bin, -40.0);

...or...

int bin=60 local

...?
I chose the red pill, then lots of white rabbits told me to burn things.
2000-12-15, 2:55 PM #10
instead of putting int bin=60 local in the can't you just put(player,60,-40) or odes that not work in this kind of language i know it works with Visual Basic code.
roses are red, violets are blue, I am schizophrenic, and I am too!
2000-12-15, 3:28 PM #11
Yes, that does work, although sometimes it is easier for people to understand what you're doing if you use that line in the symbols. You can also do int bin so you can enter the bin in Jed.. [http://forums.massassi.net/html/smile.gif]

-Jipe

↑ Up to the top!