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 → Another super easy cog
Another super easy cog
2003-03-25, 8:25 PM #1
... that I'm not experienced enough to write [http://forums.massassi.net/html/frown.gif]

I need a cog that gives any player 5 points everytime they enter a specific sector.

Your help is greatly appreciated [http://forums.massassi.net/html/smile.gif]

------------------
Beta Tester Extraordinaire
Currently Testing: OMF

Some Cool Links
Lyrics are highly overrated.
2003-03-26, 1:13 AM #2
yep really easy cog at least i think so, haven't tested it
ummm i don't understand what you mean by any player though so i just made it the local player if you need it changed just say so.
Code:
#cog script
#eter add points
#
#[SCR]
#
symbols
sector sector1
sector sector2
sector sector3
sector sector4
sector sector5
thing player local

message entered
message startup
end
code:
startup:
player = getlocalplayerthing();
return;

entered:
Setplayerscore(player, Setplayerscore + 5);
return;
end


------------------
roses are red, violets are blue, I am schizophrenic, and so am I!

[This message has been edited by Han5678 (edited March 26, 2003).]
roses are red, violets are blue, I am schizophrenic, and I am too!
2003-03-26, 6:18 AM #3
1) 'Code' does NOT need a colon.
2) In MP, 'Getlocalplayerthing()' does NOT return the local player. It returns the host. Use 'Getsenderref()' under 'Newplayer' instead.
3) You point assignment was screwed up.
4) This is all elemental, because these points will dissappear once the player dies/kills someone.
5) Download Parsec. It caught most of these errors.

Code:
#cog script
#eter add points
#
#[SCR], fixed by GBK for Pele's sake.
symbols
sector sector1
sector sector2
sector sector3
sector sector4
sector sector5
thing player local
message entered
message Newplayer
end
code

Newplayer:
player = Getsenderref();
return;

entered:
Setplayerscore(player, Getplayerscore(Player) + 5);
return;
end


------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');
And when the moment is right, I'm gonna fly a kite.
2003-03-26, 7:33 AM #4
Wow, thanks for the help fellas [http://forums.massassi.net/html/smile.gif] I really appreciate your help and will give credit.

I have one other slight request though... I need this cog to work with MP, and the points need to be fixed so they don't disapear when you die. Thanks again!

This is the last cog I need for my level to work, which I'll be releasing hopefully today [http://forums.massassi.net/html/smile.gif]

------------------
Beta Tester Extraordinaire
Currently Testing: OMF

Some Cool Links
Lyrics are highly overrated.
2003-03-26, 9:22 AM #5
Quote:
<font face="Verdana, Arial" size="2">Originally posted by GBK:
2) In MP, 'Getlocalplayerthing()' does NOT return the local player. It returns the host. Use 'Getsenderref()' under 'Newplayer' instead.</font>


If this is so then why is the player set to GetLocalPlayerThing() in the startup message of the force power cogs?


------------------
I'm just an old man with a skooma problem.
I'm just an old man with a skooma problem.
2003-03-26, 10:33 AM #6
Hmm...

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');
And when the moment is right, I'm gonna fly a kite.
2003-03-26, 2:46 PM #7
As I remember, GetLocalPlayerThing() works fine in the multiplayer.
Quote:
<font face="Verdana, Arial" size="2">
4) This is all elemental, because these points will dissappear once the player dies/kills someone.</font>


Right. So if you're still using JK's scoring system, you'll need to use:

Code:
SetPlayerKills(player, GetPlayerKills(player) + 5);


------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-03-27, 3:59 AM #8
It can't be. It's not possible. SM, that really you?

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

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-03-27, 12:28 PM #9
Sure, he's been back for a while dude.

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
Bassoon, n. A brazen instrument into which a fool blows out his brains.

↑ Up to the top!