PDA

View Full Version : Logic/expression Please help||!?


sparky99
05-15-2007, 09:36 PM
Sorry, I've read the Pawn tutorial but am not a programmer.,

Could somebody tell me what from this code :

(sand<0?-(sand):sand)

and this

get_team_num(player>0?player:newfellow)

in english mean?


Im converting a plugin and the symbols ? and the : are unfamiliar to me.

Thanks

=|[76AD]|= TatsuSaisei
05-15-2007, 11:19 PM
Sorry, I've read the Pawn tutorial but am not a programmer.,

Could somebody tell me what from this code :

(sand<0?-(sand):sand)

and this

get_team_num(player>0?player:newfellow)

in english mean?


Im converting a plugin and the symbols ? and the : are unfamiliar to me.

Thanks

abbreviated IF
get_team_num(player>0?player:newfellow)



if(player>0)
{
get_team_num(player)
}
else
{
get_team_num(newfollow)
}

sparky99
05-16-2007, 12:10 AM
That was really bugging me now I can find out why my player index is 0!

Zor
05-16-2007, 09:44 PM
The best way to do something like that is to include it in brackets so you can see the differences:


// if(player > 0) do this else this
get_team_num( ((player > 0) ? (player) : (newfellow)) )The comment helps people understand wtf...proper coding is the answer to everything...too many ppl are freak show coders...like the coders that learned coding from Java's style of coding...the ppl who started a coding convention like that should be hauled out into the street, pissed on and shot...

Cheers!

=|[76AD]|= TatsuSaisei
05-17-2007, 09:57 AM
...like the coders that learned coding from Java's style of coding...

HAD to mention JAVA huh ?? I JUST got done writing an applet for a school final project... I HATE JAVA, in case any havn't heard me say it lately...

http://JosephMeyers.com/ccc/BlackJack.html

sparky99
05-24-2007, 02:38 AM
My SoccerJam conversion is now working, just ironing out the last bugs in the player upgrades.

=|[76AD]|= TatsuSaisei
05-24-2007, 11:20 AM
My SoccerJam conversion is now working, just ironing out the last bugs in the player upgrades.

SoccerJam huh ? do tell...

sparky99
05-24-2007, 08:44 PM
http://forums.alliedmods.net/showthread.php?t=41447

I got the peeps to kick and score, the explosion effect and sound, just got to get the upgrades to work and turbo properly and the end of round to reset the game.

Also going to let the scoring team to slaughter the losers at the end of each score for 10 secs and at end of game give the winners guns before reseting like source by replaceing round timers with settask and end of game fireworks in team colours.

Its not my code or idea of course, its for CS but my son likes to play it so I converted it for Dod for him.

diamond-optic
05-24-2007, 08:56 PM
heh would that actually make the fifa whatever map fun?

sparky99
05-24-2007, 09:08 PM
Just like the FIFA map It comes with its own maps with custom entities in the map files and a FGd?? file for map editing for the ball spawn points, netareas, You can change the gravity and play space maps and basketball. The ball trails a nice orange tail so it looks a bit like a comet. We tried with guns instead of knifes but it unbalances the game.

{SR} *Raggy*
05-25-2007, 06:21 AM
It'd be cool to make maps like that :P You gotta post this up here :P I'm sure people will like that :P I'll use it anywayz :D

=|[76AD]|= TatsuSaisei
05-25-2007, 08:23 AM
It'd be cool to make maps like that :P You gotta post this up here :P I'm sure people will like that :P I'll use it anywayz :D

Yeah I am curious about the whole setup ... I can host any files you want if you have a "package" of stuff for making specific maps for this plugin...

but I really just want to see what you have done as far as package contents, and really the edits you made to a fgd and what that does for the map...

As a plugin alone it sounded interesting.. to know you went a step futher and customized the fgd for mapping, actually have a few maps designed to work with plugin, etc is all interesting to me... I have had a few concepts I wanted to employ that WOULD in fact require a few "changes" to some of the maps entities, or additions of "custom" ones... so I just want to see what you have done and "pick it apart" to see how it all works (I learn best what I know through reverse engineering)

sparky99
05-26-2007, 09:22 AM
I chose this so my son could kick the ball around on Dod. Ill put up the sma thats converted so far (IF I AM ALLOWED, could I have some guidence on this as its not my code), but you will all laff at my effort, it was hacked up to prove it could work for Dod. If you read my very first post you will get some idea of how far ahead the last two posts are. Remember I haven't coded ever!, it plays, I'm experimenting. I'll tart it up a little bit tomorrow and post it so the real coder's can address the things I've done wrong and get the things that don't work to work properly (round timers, XP). If you want to know more look at the link for the creater of the CS plugin that was posted earlier, its all there, personally I would not put it on a paid for or clan server AT ALL, my clan is used to my tinkering yours might not be so forgiving. I'll also post some questions I have about the concepts of how plugins work that I have in my head and wether to use round state triggers, timers or emulate the rounds like in CS. (Currently I'm soft killing players at score time to simulate a score ending and respawn, not nice but it can have some future fexibility for end of round bonuses)

=|[76AD]|= TatsuSaisei
05-26-2007, 12:35 PM
my clan is used to my tinkering yours might not be so forgiving.

you obviously don't know me and my clan very well... we LIVE for new and different things, and everyone is always on me about what is coming next...

but anyways post it in the TEST plugin section, especially if it still a work in progress... once you are "done" then worry about "where" to post it... just be sure to give credit to anyone whose base code you may have used...

btw, I have downloaded all the files associated with the link you provided and will look over it more sometime later today...