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 → Conveyer Control
Conveyer Control
2003-09-02, 7:34 AM #1
Hi!
I'm wondering... Is there a way to control... eh... The conveyer verb like the Sector Thrust verb? I mean in the sence of turn it on, off, change directions. Basically I'd like to make a picture on the wall to do a swaying motion. And also I might want to do an advertising sign that scrolls, stops, flashes, and moves onto the next Cel... I'm trying like this:
Code:
# Round we go.
#
# By Edward
symbols

message		startup
message		pulse

surface		screen

flex		x=1	local
flex		y=0	local
int		a=1	local
int		b=1	local
vector		vec	local

end
#
code
startup:
setpulse(0.1);
return;
pulse:
	x=x+(a/10);
	y=y+(b/10);
	vec=VectorSet(x,y,0);
	SlideWall(screen,vec,1);
	If(x>1) a=-1;
	If(x<-1) a=1;
	If(y>1) b=-1;
	If(y<-1) b=1;
return;
end

All that happens it that it scrolls one way. Doesn't go around in a circle! Any way to do so?

/Edward
Edward's Cognative Hazards
2003-09-02, 11:19 AM #2
Hi there [http://forums.massassi.net/html/smile.gif]

Well although I haven't tested it, so this is purely speculation, but I'd imagine that your pulse cycle is so fast that for most normal people's eyes, you'll be lucky if you even notice the "swaying motion" as you phrase it...

Just a thought - hope this (possibly) enlightens you [http://forums.massassi.net/html/wink.gif]

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-09-03, 5:19 AM #3
I don't think it's a pulse problem.
Now I've done some testing on my own and I came up with this:
Code:
# Round we go.
#
# By Edward
symbols

message		startup
message		pulse

surface		screen

flex		x=0	local
flex		y=0	local
flex		a=.1	local
flex		b=.1	local
vector		vec	local

end
#
code
startup:
x=rand()/10;
y=rand()/10;
setpulse(0.1);
return;
pulse:
	x=x+a;
	y=y+b;
	print("X&Y");
	printflex(x);
	printflex(y);
	vec=VectorSet(x,0,y);
	SlideWall(screen,vec,1);
	If(x>1) a=-.1;
	If(x<-1) a=.1;
	If(y>1) b=-.1;
	If(y<-1) b=.1;
return;
end

Result: The picture is scrolling in one direction only. And it seems to be going in the direction it was first set for. So, could anyone help me mkae SlideWall change the direction of a scrolling wall. I want a nice round (not has to be perfect circle) movement, possible later going to be used in the up & down of an airplane or a nice scrolling sign.

/Edward
Edward's Cognative Hazards
2003-09-09, 9:28 AM #4
HAY! Any way of having full control over the sliding of a picture? I see that SlideWall won't stop, no matter what! Any other verbs (or combination of verbs) I can use to make the wall slide as I wish?

/Edward


[This message has been edited by Edward (edited September 09, 2003).]
Edward's Cognative Hazards
2003-09-09, 11:04 AM #5
You can stop all wall from scrolling, by giving it the reverse vector of that with which it's scrolling.

So if you made it scroll (1/0/0)
stop it by giving the slidewall verb the vector (-1/0/0)

I'm not 100% sure though, but I seem to remember that it works this way.

The verb is a bit flawed, and I doubt that it is possible to make the texture swirl with it... [http://forums.massassi.net/html/frown.gif]

------------------
Call me Vedder.
Author of: A Pirate's Tale (Mots SP)
APT homepage
----
<phantom> You're always going to be aloser if you attempt to aspire to massassi standards.
<phantom> They're a bunch of socially inadequate <beep> whores who have little or no lives.

[This message has been edited by ZOOIkes (edited September 09, 2003).]
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2003-09-09, 6:05 PM #6
The verb's not flawed, you're missing the fact that your playing an ID'd animation which you can stop. Here's a simple way to do what you want:
Code:
# merrygoround.cog
#
# A simple cog to make a surface look like it's moving in circles.
# There are better ways to do this, no doubt, but options are limited
# without sin or cos functions.
#
# [SM]
#==============================================================#
symbols

message   startup
message   pulse
message   timer

surface   screen

int       animID=-1          local
int       cur=0              local
int       verbose=0

flex      x                  local
flex      y                  local

# change inc and the frameTime as needed
# to get the proper radius for your circle.
flex      inc=0.04
flex      frameTime=0.5
flex      refreshTime=0.01

vector    mvec               local

# do not use scribe or parsec with
# this type of symbol declaration.
# these values are here for nothing
# but to make sure that JED shows
# them.
vector    vec0=(0/0/1)
vector    vec1=(0.5/0/0.5)
vector    vec2=(1/0/0)
vector    vec3=(0.5/0/-0.5)
vector    vec4=(0/0/-1)
vector    vec5=(0/0/-1)
vector    vec6=(-0.5/0/-0.5)
vector    vec7=(-1/0/0)
vector    vec8=(-0.5/0/0.5)
vector    vec9=(0/0/1)

end
#==============================================================#
#
code
#------------------------------------------------------
startup:
	// get things started.
	SetPulse(refreshTime);
	SetTimer(frameTime);

Return;
#------------------------------------------------------
pulse:
	// the anim that played during the last pulse
	// we don't want more than one playing at once.
	StopAnim(animID);

	// let our experimenting user see what
	// part of the circle we're on.
	if(verbose) PrintInt(cur);

	// gradually fade x and y by the inc amount
	// so that the circular movement looks smooth.
	if(x + inc < VectorX(vec0[cur])) x = x + inc;
	else if(x - inc > VectorX(vec0[cur])) x = x - inc;
	if(y + inc < VectorZ(vec0[cur])) y = y + inc;
	else if(y - inc > VectorZ(vec0[cur])) y = y - inc;

	// build our mvec.
	mvec = VectorSet(x, 0, y);

	// play a surface anim with our new mvec.
	animID = SlideSurface(screen, mvec, 1);

Return;
#------------------------------------------------------
timer:
	// reset x and y to the values for the part
	// of the circle that is just being passed over.
	// remember that x and y may not have
	// reached these values by now - they
	// may still be inc/dec -ing in the pulse.
	x = VectorX(vec0[cur]);
	y = VectorZ(vec0[cur]);

	// get to the next frame.
	cur = cur + 1;

	// after the tenth frame, go back to the first.
	if(cur > 9) cur = 0;

	// set the timer again.
	SetTimer(frameTime);

Return;
#------------------------------------------------------
end


------------------
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-09-10, 2:57 AM #7
Thank you! That worked! All is swaying!

/Edward
Edward's Cognative Hazards
2003-09-10, 3:38 AM #8
Sure. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!