Duke4.net Forums: About the STRIPEBALL and QUEBALL - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

About the STRIPEBALL and QUEBALL  "You know those pool table balls"

User is offline   Zaxtor 

#1

I'm trying to find how they are made (their code) but can't find any info.
I searched roll on Edukewiki it doesn't seem to be something I'm looking for.

I'm trying to find a code to make something when you shoot or push space it rolls just same as pool balls.
But it doesn't break (unbreakable).

Do you know any codes to make something that act the same as the STRIPEBALL and QUEBALL accept it doesn't breaks.?
Don't want em to break.

This post has been edited by Zaxtor: 02 February 2011 - 09:52 AM

0

#2

Are you willing to make a custom CON file for us to download so we can play?
0

User is offline   CruX 

#3

All you really have to do is create a useractor that checks the player's angles, changes its own angles accordingly, and moves when the player presses space on it. There's probably a more efficient way of doing it, but here's what I came up with...

define PUSHBALL 3347 // This is a blank tile in #13 ART tile. I just copy/pasted it from tile #1220

gamevar PERPLAYER1 0 1
gamevar PERPLAYER2 0 1
gamevar TEMP1 0 2
gamevar TEMP2 0 2
gamevar TEMP3 0 2
gamevar ANGVAR 0 2 // These are all the gamevar declarations needed. Just a bunch of peractor/player vars used for storing angle values, etc. 

move STOP
move SLIDE1 75
move SLIDE2 50
move SLIDE3 25 // And these are the different velocities at which the ball moves after it's been pushed. Doing it this way gives it the illusion that the ball's slowing down as it rolls.

action BALLIDLES 0 1 1 1 1 // just an idle action that the actor's initiated to

useractor notenemy PUSHBALL 0 BALLIDLES
cstat 1 sizeat 25 25 ifpdistl 1200 {
ifp pfacing { ifhitspace { ifaction BALLIDLES { // if the player hits space on the ball while within a certain distance (and of course, the ball is still idling...)
getplayer[THISACTOR].posx PERPLAYER1 // execute the next block of code
getplayer[THISACTOR].posy PERPLAYER2
getactor[THISACTOR].x TEMP1
getactor[THISACTOR].y TEMP2
subvarvar PERPLAYER1 TEMP1
subvarvar PERPLAYER2 TEMP2
getangle ANGVAR PERPLAYER1 PERPLAYER2 // get the angle the ball would need to be facing the player...
subvar ANGVAR 960 // and then make it face the opposite direction. Funny thing is, I thought you'd have to multiply the value by -1 if it was less than zero, but that actually kept it from working properly
setactor[THISACTOR].ang ANGVAR
move SLIDE1 geth } } } } // and this next bit of code just makes it slide around horizontally, slowing it down by changing out the move commands as time goes on, till it stops altogether.
ifmove SLIDE1 { ifcount 10 { move SLIDE2 geth } }
else
ifmove SLIDE2 { ifcount 20 { move SLIDE3 geth } }
else
ifmove SLIDE3 { ifcount 30 { action BALLIDLES move STOP } } enda
And that's all there really is to it. You could probably also use the movesprite command, but I figured this would be a better way to go about it.
0

#4

Hey, I've never understood how the Move command worked and have been trying to figure it out for ages! Basically, I just want to say, thanks, even though you didn't intend this code to be of use to me, thanks for simplifying the use of that command.
0

User is offline   Zaxtor 

#5

It works thx a lot.

I called it IRONBALL,
0

#6

View PostHigh Treason, on Feb 3 2011, 06:54 PM, said:

Hey, I've never understood how the Move command worked and have been trying to figure it out for ages! Basically, I just want to say, thanks, even though you didn't intend this code to be of use to me, thanks for simplifying the use of that command.


The move command is what makes an actor, uhh move xD You define the move command with a number, that number is the speed it will move at. Then the location you put in the move command, you can tell it how to move.
Could be away from player, or making the actor look at the player.
0

#7

Oh, I know what the command is for, I just never really understood how to use it, the last time I looked it up on EDuke Wiki it had some redundant description like;

"The Move Command is used to make Actors Move."

With no examples or any proper explanation of it's syntax, many commands are like this on the Wiki. For some reason, I could never get it working either and gave up, but after copying of how it was used in EmericaSkater's example I can get it to work to some extent, though I am not entirely sure where I went wrong previously as I hadn't tried experimenting with it in about a year.

Keep in mind that CON is quite far from the Commodore 64 BASIC and similar languages that I am used to using.
0

User is offline   CruX 

#8

I'm surprised you were as nice in responding to that blatant (and somewhat condescending) "METOOMETOO" post above yours as you were, but maybe that's just me. I sort of have the same problem you do with some of the vanilla commands i.e, they seem like they should be a bit simpler to work with but they still kinda leave me scratching my head.

I'd actually originally tried using some of the move command's other directional values when I first threw that code together (faceplayer, fleeenemy, etc.) but it wasn't working the way I wanted it to, so I eventually decided to just manipulate the actor's angles directly. Whatever works, I guess.

This post has been edited by EmericaSkater: 04 February 2011 - 07:09 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#9

View PostZaxtor, on Feb 3 2011, 10:14 AM, said:

I called it IRONBALL,


Call them BALLSOFSTEEL.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options