PDA

View Full Version : Another super easy cog



MrRavenX
03-25-2003, 11:25 PM
... 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 (http://www.omf.com/)

Some (http://http://www.homestarrunner.com/) Cool (http://www.actsofgord.com/) Links (http://www.jbowers.com/mame/)

Han5678
03-26-2003, 04:13 AM
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.


#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).]

gbk
03-26-2003, 09:18 AM
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.



#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');

MrRavenX
03-26-2003, 10:33 AM
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 (http://www.omf.com/)

Some (http://http://www.homestarrunner.com/) Cool (http://www.actsofgord.com/) Links (http://www.jbowers.com/mame/)

GuNbOy
03-26-2003, 12:22 PM
<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.

gbk
03-26-2003, 01:33 PM
Hmm...

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');

SaberMaster
03-26-2003, 05:46 PM
As I remember, GetLocalPlayerThing() works fine in the multiplayer.

<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:



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


------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), Scribe (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).

Descent_pilot
03-27-2003, 06:59 AM
It can't be. It's not possible. SM, that really you?

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

The Magician Saber System.

Emon
03-27-2003, 03:28 PM
Sure, he's been back for a while dude.

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