Author |
Message |
|
Radical Pi
Advanced Member
Joined: 23 Nov 2005 Posts: 455
|
Posted: 10 Mar 2006 06:22:23 pm Post subject: |
|
|
character_location = X
new character = Str2
string = Str1 Code: sub(Str1,1,X-1)+Str2+sub(Str1,X+1,length(Str1)-X
Last edited by Guest on 10 Mar 2006 06:22:51 pm; edited 1 time in total |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 10 Mar 2006 07:23:06 pm Post subject: |
|
|
That causes a domain error if the character changed is either first or last one in the string.
[font="courier new"]"░"+Str1+"░
sub(sub(Ans,1,X)+Str2+sub(Ans,X+2,length(Ans)-X-1),2,length(Str1→Str1
This works, but it may not be fully optimized. I'll try to figure out if it is.
Nope, can't find an alternative.
Last edited by Guest on 10 Mar 2006 07:52:03 pm; edited 1 time in total |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 10 Mar 2006 08:57:48 pm Post subject: |
|
|
The way I'm using it, it never ends up being 1'st or last character so Radical Pi's techniqe is perfect.
Also Weregoose: the way that you gave me to pick out the numbers from a list is good but is there a more time efficiant way for a fairly large list? |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 11 Mar 2006 08:31:01 pm Post subject: |
|
|
Actually, now that you mention it, there is a faster way:
[font="courier new"](L1>X and L1<Y)L1→L2 to replace [font="courier new"]seq(L1(θ)(L1(θ)>X and L1(θ)<Y),θ,1,dim(L1→L2
Again, though, does the order matter?
Last edited by Guest on 11 Mar 2006 08:32:45 pm; edited 1 time in total |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 17 Mar 2006 09:39:01 pm Post subject: |
|
|
Yes it does. Accually what you showed me is exactly how far I'd gotten on my own but much more efficiant in all respects.
Here is exactly what I'm using it for:
Each soldier is outputed using a StatPlot L1,L2. I want for the soldeirs selected in a drawn out box to be moved to L3 and L4 where they can be edited and upgraded as wished. This is the step I am on, battle commands. I realise now I didn't make it clear at all. |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 21 Mar 2006 05:02:52 pm Post subject: |
|
|
Please, I've spent many hours (think near triple digits) trying to figure this out. |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 23 Mar 2006 06:25:55 pm Post subject: |
|
|
Here is the RPG map's scrolling engine with no layers so far:
W is width of map Str1 is map.
Quote: ClrDraw
ZStandard
Repeat 0
For(X,-2,2
Text(-1,7(X+2),1,sub(Str1,A-7-WX,16
End
Horizontal -1.2
Text(-1,13,43,"*
Repeat Ans
Getkey
end
A-(Ans=24)+(Ans=26)+W((Ans=25)-(Ans=34
If sub(str1,Ans,1)="
Ans->A
End
I need speed optimizations in order for graphics to be a possibility. Please help. |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 24 Mar 2006 06:36:24 pm Post subject: |
|
|
Would someone please optimise that code for speed. I did as much as I can and when I tried it with layers it was horrific. |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 24 Mar 2006 07:22:30 pm Post subject: |
|
|
[font="courier new"]7(X+2) becomes [font="courier new"]7X+14. That's all I got. |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 24 Mar 2006 07:47:59 pm Post subject: |
|
|
Yeah, I'd made that one at school today accually... hadn't updated the code. If I take the Text('s out of for( loop would it be faster considering the multiple layers? |
|
Back to top |
|
|
Radical Pi
Advanced Member
Joined: 23 Nov 2005 Posts: 455
|
Posted: 24 Mar 2006 07:52:08 pm Post subject: |
|
|
In the sense that there would be less calculating involved, yes. |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 27 Mar 2006 07:19:27 pm Post subject: |
|
|
That's what I thought. *Sigh* maybe I'll hav to switch to output... but then I wouldn't be able to use my cleanscroll idea... anyone have any advice. |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 30 Mar 2006 03:50:20 pm Post subject: |
|
|
Can someone make this faster, I got it as good as I could. it's a simple sprite for your "base", set deltaX to 1 and same for deltaY:
Line(0,0,0,5
Line(1,0,1,2
Line(3,0,3,2
Line(4,0,4,5
Line(1,4,3,4
Line(2,2,2,5
Can't use a StatPlot, wouldn't work strait for this game. |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 30 Mar 2006 09:54:28 pm Post subject: |
|
|
[font="courier new"]Line(0,0,0,5
Line(4,0,4,5
Pt-On(2,4,3
Pt-On(2,1,2
Pt-Off(2,0
|
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 30 Mar 2006 10:40:46 pm Post subject: |
|
|
Thank's, I didn't realise you could use point-on quite in that way... it'll come in handy. In war on top of your base a line appears that represents how much of it is not-destroyed. As more enemy's attack it, it drains quicker. An enemy attacking a base cannot be stopped, so it drains until game ends, thank god your base has plenty of health. If your soldeir touchs an enemy soldier in your teritory (i.e. where you can spawn) the enemy dies. If it is in enemy territory then visa-versa.
This is the current state of "War" rules and I've been spending much of my time working on it. The current way soldiers die though I find quite boring so any advice on this will be greatly appreciated as will anything else.
Edit:
I would love to post some screenshot's...(some of the stuff is pretty... even if I havn't made the soldiers move yet)... how is this done?
Last edited by Guest on 30 Mar 2006 11:18:30 pm; edited 1 time in total |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 01 Apr 2006 06:00:22 pm Post subject: |
|
|
I decided to switch to output... sigh. Oh well... so now I'll post one of the tricks I was going to use in the RPG:
For clean scrolling: I had two rows and colubms on two characters thick above/below/side, stored it as a picture and used a for-loop to display over and over the map with one pixle change each display while recalling the picture of the rows and colums.
Comments... I see now without a library this would never work and you could do much better anyway with a library.
I've made alot of progress in all projects and a demo of war may or may not be available soon (depends on how quick I can iron out some big graphics bugs). |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 15 May 2006 10:32:10 pm Post subject: |
|
|
Ok, here's the thing. I have several engine idea's but cannot decide which one to use:
1. Standard boring scrolling engine that uses output (I made several of these before)
2. A 2D physics based engine which has several different kind's of tiles each of which effects the physics of objects moving over it (i.e. ice tile decreases friction).
3. A 3D first person game. This sounds cool and I've experemented enough to know how to do it but, it would alow for minimal actual gameplay and may be quite boring.
4. I have a guy walk around the screen with AI enemy's attacking him in game, this would go against the origanal idea of turnbased combat but so what. You can set attacks to different buttons. Earth attacks for close up, fire for high damage etc. |
|
Back to top |
|
|
|