OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 15 Jun 2005, 19:37:21

Title: pic not 2n
Post by: 456820 on 15 Jun 2005, 19:37:21
ofp is being very weird and saying i cant have a pic wich is
width = 80
height = 40
wich 40 goes into 80 so it should work unless 80 has to go into 40
anyway its not working and uses the overview pic instead of the one i told it to called
sniper_badge.jpg

Code: [Select]
<html>
<body>

<!-- Overview Title -->
<br><h2 align="center"><a name="Main">
10. Sniper
</a></h2>

<!-- Overview Picture -->
<p align="center"><img src="pic.jpg" width="128" height="64"></p>
<br><br><br>
<p align="right"><img src="sniper_badge.jpg" width="80" height="40"></p>

<!-- Overview Text -->
<p><br>

<br></p>
</body>
</html>
thats my overview file inacse there is anything wrong with it also ofp also sometimes choses a different pic than the one specified for some weird reason so i end up having a picture of a different mission
i do call the pics the same name in my overview so is that causing it
anyway whats wrond with my dimensions they are 2n
Title: Re:pic not 2n
Post by: Planck on 15 Jun 2005, 20:19:51
Pictures need to be in powers of 2 (2n)

Valid values for powers of 2 are:

2
4
8
16
32
64
128
256
512
1024
etc
etc

In short, starting with 2, you multiply by 2 to get the next value, then multiply by 2 again......etc....etc..


Planck
Title: Re:pic not 2n
Post by: Blanco on 16 Jun 2005, 00:32:58
HERE (http://www.ofpec.com/editors/resource_view.php?id=2) is some usefull info
Title: Re:pic not 2n
Post by: Sui on 16 Jun 2005, 07:26:20
Actually, in the briefing.html you can make the picture any size you want.

The physical size of the picture (ie if you opened it up in paint/photoshop etc.) has to be ^2.

Your briefing is fine, but you'll need to resize the actual picture itself in a photo editing program along the guidelines of what Planck suggested ;)
Title: Re:pic not 2n
Post by: 456820 on 16 Jun 2005, 16:37:08
thats exactly what i did aswell the phot itself is 80 by 40 but thats pixels does it need to be something else ?
Title: Re:pic not 2n
Post by: qqqqqq on 16 Jun 2005, 17:25:26
It's pixels.

Read the thread again.  

Hint quiz:  if 2^n=8, what is the value of n?
Title: Re:pic not 2n
Post by: 456820 on 16 Jun 2005, 17:28:37
Quote
Hint quiz:  if 2^n=8, what is the value of n?
its 4

so my pixels should be right 2^n=80 and in that n=40 like in my pic

amyway ill read the thread again
Title: Re:pic not 2n
Post by: qqqqqq on 16 Jun 2005, 18:54:47
Would you like to guess again?

The correct answer is 3.

2^3 = 2*2*2 = 8

"2 to the power of n" means 2 multiplied by itself (i.e. 2) n times.    n can be 0, 1, 2 or 3 etc..

^ means "to the power of"
* means multiply
Title: Re:pic not 2n
Post by: 456820 on 16 Jun 2005, 19:20:01
oh yh RAAA i forgot were talking about powers i though it was just n as in algebra anyway so what is the correct pixels
Title: Re:pic not 2n
Post by: bedges on 16 Jun 2005, 19:57:18
sigh.... okay.

you must make the dimensions of the ACTUAL image file a power of 2, i.e. 128, 256, 512 etc.

the picture in your BRIEFING can be ANY size.

so, for example, if your image is 128px * 512px, you can make its size 2000 * 37 in the briefing, by using

Code: [Select]
<img src="pic.jpg" width="2000" height="37">
Title: Re:pic not 2n
Post by: qqqqqq on 16 Jun 2005, 21:17:41
Quote
so what is the correct pixels

Your question was answered comprehensively by Planck.    I'd be interested to hear why you didn't bother reading that post.
Title: Re:pic not 2n
Post by: bedges on 16 Jun 2005, 21:41:06
now now, mistakes are made by us all. hopefully the thread will have helped sort things out. meantime, helpful comments only please.  ::)
Title: Re:pic not 2n
Post by: qqqqqq on 16 Jun 2005, 22:11:54
OK sorry.   :)
Title: Re:pic not 2n
Post by: 456820 on 17 Jun 2005, 16:11:19
Quote
I'd be interested to hear why you didn't bother reading that post.
actually i did just didnt understand it much anyway i got it working now thanks alot